![]() ![]() I'm coding in Delphi and using the Windows and SysUtils units:įFileStreamOne := TFileStream.Create( fFileName, fmOpenRead or fmShareDenyNone ) įFileStreamTwo := TFileStream. any ideas? (I can't change the code for the app that's writing to the log) While it's the simplest method, it could consume damn much memory (up to 5FileSize when reading one-byte encoding). However, the app that needs to write to the file errors out w 'Cannot open log file C:\XXX.log' - it's trying to open the same file in fmOpenReadWrite or fmShareCompat. TStringList first reads whole file to a buffer, recodes it to string and then splits it up to lines. I have the file open in fmOpenRead or fmShareDenynone and have no issues with opening. ![]() My issue is that there is a process running that needs to write to the file which may be during the time I am reading. I have tried with FileStream, AssignFile and even CopyFile. I would like to scan a log file in read only mode w no locking.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |