Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2008 Mar : FS := TFilestream.Create(S, fmOpenRead or fmShareDenyNone); // Isn't working
| Subject: | FS := TFilestream.Create(S, fmOpenRead or fmShareDenyNone); // Isn't working |
| Posted by: | "Jon P. Grewer" (jonnospamthanks@grewer.net) |
| Date: | Mon, 17 Mar 2008 02:05:09 |
Hello!
I have a need to open a file for processing that is open by another
process. I only need to read it. A search of Tamarack shows that the
following code should work but it doesn't. I get an exception:
'EFOpenError with message 'Cannot open file "C:\blah\blah.zzz". The
process cannot access the file because it is being used by another
process'.
What am I missing?
Thanks.
procedure ProcessMyFile(Filename :String);
Var
FS : TFilestream;
begin
// the next line generates an exception
FS := TFilestream.Create(Filename, fmOpenRead or fmShareDenyNone);
.
.
end;
--
________
In communication 101, I am required to give a speech on drugs. But I
don't think I can deliver a good speech while on drugs!