[solved] Reading a file that is used by another program.
[solved] Reading a file that is used by another program.
Is it somehow possible to read a file that is currently being written by another program? ReadFile/OpenFile will always return 0 but opening the file with notepad works fine.
Last edited by coldhands on Mon Jan 31, 2011 12:37 pm, edited 1 time in total.
- Rook Zimbabwe
- Addict
- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
Re: Reading a file that is used by another program.
what type of file?
The reason this ia asked is: If it is a DB file maybe the answer wold be NO... if it is a TXT file you shouldn't have any issues... itis going to depend on the type of file and access rights for that file depending on windows version etc.
The reason this ia asked is: If it is a DB file maybe the answer wold be NO... if it is a TXT file you shouldn't have any issues... itis going to depend on the type of file and access rights for that file depending on windows version etc.
Re: Reading a file that is used by another program.
I solved the problem using WinAPI functions for file access, as described in http://www.purebasic.fr/english/viewtop ... 13&t=41197. Thanks to mk-soft 
About the files: They're Age of Empires 2 Recorded Games. I'm streaming them from one computer to another live as they're being created, simulating a spectators mode for the game.

About the files: They're Age of Empires 2 Recorded Games. I'm streaming them from one computer to another live as they're being created, simulating a spectators mode for the game.
Re: Reading a file that is used by another program.
nice. that would be something worth sharingcoldhands wrote:About the files: They're Age of Empires 2 Recorded Games. I'm streaming them from one computer to another live as they're being created, simulating a spectators mode for the game.

- Rook Zimbabwe
- Addict
- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
Re: [solved] Reading a file that is used by another program.
That does sound EXTREMELY cool! I am thinking API may be the only way to do that too!