G
Guest
I have a bit of a problem. I need to determine if a file is in use, to know
whether or not I can overwrite it. At first I tried calling the
GetModuleHandleA function, but that always returns that the file is free. I
then tried to open the file with a file stream, if an error occurred the file
was in use. My problem with that, is there is no consistency. I can test it
10 times, and get 50/50 results, when I know the file is currently being
accessed. I'm not sure what else to try.
Any suggestions would be appreciated.
Thanks in advance,
Jeff
whether or not I can overwrite it. At first I tried calling the
GetModuleHandleA function, but that always returns that the file is free. I
then tried to open the file with a file stream, if an error occurred the file
was in use. My problem with that, is there is no consistency. I can test it
10 times, and get 50/50 results, when I know the file is currently being
accessed. I'm not sure what else to try.
Any suggestions would be appreciated.
Thanks in advance,
Jeff