Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2007 Jan : Reading locked files
| Subject: | Reading locked files |
| Posted by: | "Mikael Lenfors" (mika..@lenfors.se) |
| Date: | Wed, 31 Jan 2007 23:04:14 |
Hello!
I have a problem reading "locked" files. I want to monitor some logfiles
created by another program that I bought. The logfiles are opened from the
program and locked. If i try to open the logfile with WordPad I get an error
message, but if I open it with Notepad it works! This means it is possible!
So far I tried to open it with the following code (found on a newsgroup)
Exclusive: FILE;
System.FileMode := fmShareExclusive;
AssignFile (Exclusive, 'filename');
Reset (Exclusive, 1); {Read 1-byte at a time}
But it still returns I/O error 32.
Any ideas?
regards, Mikael