ReadFile function

Just starting out? Need help? Post your questions and find answers here.
User avatar
SPP
User
User
Posts: 44
Joined: Sun Mar 04, 2007 10:34 am
Location: BCN - SPAIN

ReadFile function

Post 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
The PB community is great... nice to meet you!
User avatar
em_uk
Enthusiast
Enthusiast
Posts: 366
Joined: Sun Aug 08, 2010 3:32 pm
Location: Manchester UK

Re: ReadFile function

Post by em_uk »

Close the file after you have read your data.
----

R Tape loading error, 0:1
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: ReadFile function

Post by c4s »

Take a look on this code to open the file "non-exclusively":
http://www.purebasic.fr/english/viewtop ... 92#p316992
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
User avatar
SPP
User
User
Posts: 44
Joined: Sun Mar 04, 2007 10:34 am
Location: BCN - SPAIN

Re: ReadFile function

Post 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.
The PB community is great... nice to meet you!
User avatar
SPP
User
User
Posts: 44
Joined: Sun Mar 04, 2007 10:34 am
Location: BCN - SPAIN

Re: ReadFile function

Post 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.
The PB community is great... nice to meet you!
Post Reply