Roger,
This is not for a dbf, just to clarify.
We import images, some users importing hundreds at a time to attach to different data files. Recently at one of our sites the import is crashing because somebody on the other end has one of the image files open. We fail in copying the file to the image save folder, and also will eventually fail when attempting to erase it when completed.
Is there a method to check to see if the file can be copied and just skip it until the next import? Not exactly an express or alaska quesiton, but thought somebody else may have run across this type of issue. Maybe some sort of if(copy) or something that already exists.
Thanks,
Fred
Omni
Checking For File being open
Re: Checking For File being open
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Checking For File being open
if erasing, you can also use fexists to check if the file is still there..
on copying, you can compare date/times/sizes after the copy
on copying, you can compare date/times/sizes after the copy
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: Checking For File being open
Rogers bit of code at the end is what was needed. Worked perfect.
Thanks
Thanks
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: Checking For File being open
When Roger is such a decision, Kotra works well. It may be suitable in this case?
And Tom advised to determine whether or not a file is opened on the fact of the existence of a temporary file, which is generated when opening and udalat at closing.
Code: Select all
**********************************************************
******** Проверка, открыт файл или нет (от Роджера Доннея)
**********************************************************
FUNCTION IsFileOpened( cFileName )
*#include "fileio.ch"
LOCAL lStatus := .F. // Файл cFileName закрыт
LOCAL nHandle := FOpen( cFileName, FO_READWRITE+FO_DENYWRITE )
IF nHandle <= 0
lStatus := .T. // Файл cFileName открыт или его нет
ELSE
FClose(nHandle)
ENDIF
RETURN lStatus