10-01-2017, 05:23 PM
Retry when fails
----------------------------------
or use one of these functions
Function FileTryOpenForReadWrite
Function FileTryOpenForRead
example
----------------------------------
or use one of these functions
Function FileTryOpenForReadWrite
;/
function# $filePath
;Returns 0 if the specified file exists and can be opened for read/write access (and can be moved etc).
;Else returns an error code.
;Some error codes:
;;;ERROR_FILE_NOT_FOUND (2) - the file does not exist.
;;;ERROR_PATH_NOT_FOUND (3) - the directory does not exist.
;;;ERROR_ACCESS_DENIED (5) - read-only or protected.
;;;ERROR_SHARING_VIOLATION (32) - is already open, for example by another process.
_s.expandpath(filePath)
int h=CreateFileW(@_s GENERIC_READ|GENERIC_WRITE 0 0 OPEN_EXISTING FILE_ATTRIBUTE_NORMAL 0)
if(h==INVALID_HANDLE_VALUE) ret GetLastError
CloseHandle h
;/
function# $filePath
;Returns 0 if the specified file exists and can be opened for read access.
;Else returns an error code.
;Some error codes:
;;;ERROR_FILE_NOT_FOUND (2) - the file does not exist.
;;;ERROR_PATH_NOT_FOUND (3) - the directory does not exist.
;;;ERROR_SHARING_VIOLATION (32) - is already open, for example by another process.
_s.expandpath(filePath)
int h=CreateFileW(@_s GENERIC_READ 0 0 OPEN_EXISTING FILE_ATTRIBUTE_NORMAL 0)
if(h==INVALID_HANDLE_VALUE) ret GetLastError
CloseHandle h
example