When I attempt to rename a file by changing the file extension in Explorer
in a directory checked by the below script, I get an error telling me that
the file is locked by another process. Interestingly, the win.debug command
below doesn't fire.
If I then copy a file into this directory, which does fire the message in
the debug window and terminates the watchfolder thread, I am able to rename
the file without a problem, so I believe I've isolated the problem to the
watchfolder function.
Even if I comment out all the lines in the below script, the error will
occur until the watch folder is terminated, so I'm stuck on what else I can
check to further isolate the problem.
Upgrading to 4.2.09 didn't solve the problem. I also tried different
directories (incl c:\), and rebooting the computer to clear out any locks
from other processes.
Script is named 'Filebackup.powerpro'
;-------------------------------------------------------
file.watchfolder(?"C:\awrdswrk\v2000\Source\Frame\Tests\",
?"[EMAIL PROTECTED](,)", 0, "file") quit
@Executed
local extension
;arg(1) is folder
;arg(2) is file name
;file.watchfolder(arg(1), ?"[EMAIL PROTECTED](,)", 0, "file
lastwrite")
win.debug(arg(2))
extension = case("lower", file.type(arg(2)))
if (not ((extension eq "pas") or (extension eq "dfm") or (extension eq
"tlb") or (extension eq "dpr") ) )
quit
if (file.isfolder(arg(1)++arg(2)))
quit
file.copy(arg(1)++arg(2), arg(1)++?"BackupFiles\"++file.name(arg(2))++"
"++date++" "++time++"."++file.type(arg(2)))
;-------------------------------------------------------
Paul
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/