DYONISII Posted July 14, 2009 Posted July 14, 2009 (edited) i am currently using: $handle = _WinAPI_CreateFile($filename, 2, 2) if $handle then ;do process here else msgbox(0,"warning","file can not be opened.") endif however i want to know how i can open $filename even if it has been opened by another application. the fourth argument is $iAttributes with possible values: 1=file should be archived; 2=file is hidden; 4=file is read only; 8=file is part of or used exclusively by an operating system. using 4 for $iAttributes won't allow me to open $filename if it is already open. any help would be appreciated. thanks! Edited July 14, 2009 by DYONISII http://dev.dyonisii.com/
dantay9 Posted July 14, 2009 Posted July 14, 2009 Well, you can try fileclose. Also take a look at fileopen. It can be used easier than _WinAPI_CreateFile(). Just a suggestion.
DYONISII Posted July 14, 2009 Author Posted July 14, 2009 (edited) dantay9, thanks for your quick reply. i can't use fileopen() because the files that i need to open may be as big as 4Gb or even larger. i am also using _WinAPI_CreateFile() in conjunction with _WinAPI_ReadFile(). further, if the file has been opened by another application, i am not allowed to close it. i just need to read from it, if it has been opened already. Edited July 14, 2009 by DYONISII http://dev.dyonisii.com/
rover Posted July 14, 2009 Posted July 14, 2009 i am currently using: $handle = _WinAPI_CreateFile($filename, 2, 2) if $handle then ;do process here else msgbox(0,"warning","file can not be opened.") endif however i want to know how i can open $filename even if it has been opened by another application. the fourth argument is $iAttributes with possible values: 1=file should be archived; 2=file is hidden; 4=file is read only; 8=file is part of or used exclusively by an operating system. using 4 for $iAttributes won't allow me to open $filename if it is already open. any help would be appreciated. thanks! $handle = _WinAPI_CreateFile($filename, 2, 2, 7) cheers I see fascists...
DYONISII Posted July 14, 2009 Author Posted July 14, 2009 (edited) rover,thanks so much. i don't know why i totally forgot that the arguments can be added together LOL!i tried 2, and it worked but wondered why 4 won't work. turns out 7 is the correct argument.thanks so much.now, my torrent maker is finally done! Edited July 14, 2009 by DYONISII http://dev.dyonisii.com/
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now