Hi everybody
Is there any way, in an actionscript, to check if a folder is locked by a process (there are no files inside) and avoid the error on āfolder deleteā command?
Thanks
How about something like:
continue if {(number of folders of it + number of files of it) of folder āC:\tempā = 0}
You would likely need to use an action with a program or script or command that can delete locked folders instead of using folder delete.
So it seems that thereās no way to check if a folder is locked ?
There should be through relevance, but Iām not certain. It should definitely be possible with a script or EXE of some sort.
Ah, I misunderstood the initial request (i thought we were looking for empty folder conditions, but this makes much more sense now). There is no way to do this via relevance as far as I know, but there are a number of utilities that can assist. Assuming this is Windows, you should be able to leverage the following utility to search for open handles containing the given folder:
I would use the ādosā command in actionscript. This will attempt to delete the folder, but will not error out if the folder cannot be deleted due to a lock:
dos rmdir /s /q c:\my\folder\name
Thanks Jason. Itās exactly what we have done:-)