Modify

#3577 closed Bug (No Bug)

_FileWriteToLine strips @crlf off last line for some files

Reported by: BrianM Owned by:
Milestone: Component: AutoIt
Version: 3.3.14.1 Severity: None
Keywords: _FileWriteToLine Cc:

Description

compared the .log to the .log_after files and notice the fail case has the last @crlf removed.

#include <File.au3>

Local $sSourceLine = "227487744 148299776 11.1.6749897"

Local $sTargetFilename = "fail.log"

Local $sFilenameTmp = $sTargetFilename & "_after"
FileCopy($sTargetFilename,$sFilenameTmp,$FC_OVERWRITE)
_FileWriteToLine($sFilenameTmp,2,$sSourceLine)

Local $sTargetFilename = "pass.log"

Local $sFilenameTmp = $sTargetFilename & "_after"
FileCopy($sTargetFilename,$sFilenameTmp,$FC_OVERWRITE)
_FileWriteToLine($sFilenameTmp,2,$sSourceLine)

Attachments (2)

fail.log (427 bytes ) - added by BrianM on Dec 1, 2017 at 11:49:53 PM.
failing case
pass.log (83 bytes ) - added by BrianM on Dec 1, 2017 at 11:50:15 PM.
passing case

Download all attachments as: .zip

Change History (4)

by BrianM, on Dec 1, 2017 at 11:49:53 PM

Attachment: fail.log added

failing case

by BrianM, on Dec 1, 2017 at 11:50:15 PM

Attachment: pass.log added

passing case

comment:1 by BrewManNH, on Dec 14, 2017 at 9:48:20 PM

The way the function is written, it's going to strip the last CRLF off of any file. The reason that pass.log works is because there's only 2 lines in it and you're adding the line at the second line. I'm not sure if it's a bug or a design decision.

comment:2 by J-Paul Mesnage, on Jan 29, 2018 at 3:08:04 PM

Resolution: No Bug
Status: newclosed

Design decision

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.