Page 1 of 1

ReadFile function

Posted: Tue Aug 23, 2011 6:19 pm
by SPP
Hi to all (and sorry for my English),

The ReadFile function opens a file in a read only mode, but if another program (like notepad) opens the same file and tries to save it, Windows does not allow it.
Anybody knows if is possible avoid this or how to perform the same in other way?

Thanks in advance.
Regards

Re: ReadFile function

Posted: Wed Aug 24, 2011 3:59 am
by em_uk
Close the file after you have read your data.

Re: ReadFile function

Posted: Wed Aug 24, 2011 9:20 am
by c4s
Take a look on this code to open the file "non-exclusively":
http://www.purebasic.fr/english/viewtop ... 92#p316992

Re: ReadFile function

Posted: Wed Aug 24, 2011 4:20 pm
by SPP
em_uk wrote:Close the file after you have read your data.
:) :)
The problem is that both programs can access the same file at the same time.

Re: ReadFile function

Posted: Wed Aug 24, 2011 4:22 pm
by SPP
c4s wrote:Take a look on this code to open the file "non-exclusively":
http://www.purebasic.fr/english/viewtop ... 92#p316992
Thank you c4s, I think this is what I need.