What might be the reasons for that exception even though the file is present at correct path as specified.This is a Selinium-Grid job and was obeserved when it was terminated due to the same reason.
-Aneesh.
Last edit: Aneesh 2016-10-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The STAFResult shows that the FS DELETE directory request failed with STAF return code 50 (Directory Not Empty) because it got operating system return code (osRC) 32 when trying to delete file C:(path)\bin\Drivers\IEDriver\IEDriverServer.exe. You can use a "net helpmsg" command on Windows to get more information about Windows error codes (or google it):
C:\>net helpmsg 32
The process cannot access the file because it is being used by another process.
If errors were encountered deleting entries and IGNOREERRORS was not specified, the result buffer will contain a marshalled <List> of <Map:STAF/Service/FS/ErrorInfo> representing a list of error information about the entries that were not successfully deleted.
So, how to know which process is using that perticular file so that it can be kill and continue the operation with that file. Tried googleing for the solution, but no luck.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The STAF FS service's DELETE request cannot force the deletion of a file that is in use by another process.
You can google for ways to force the deletion of a file that is in use on Windows. For example, at https://www.sitepoint.com/web-foundations/force-windows-delete-file/, it talks about using the Windows del command with the /f (force) option to force the deletion of a file. For example: ‘del /f filename’. You could run this command via a <process> element in your STAX job.
You can get the name of the locked file from the STAFResult set by the <stafcmd> performing the FS DELETE request.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What might be the reasons for that exception even though the file is present at correct path as specified.This is a Selinium-Grid job and was obeserved when it was terminated due to the same reason.
-Aneesh.
Last edit: Aneesh 2016-10-06
Please provide more information.
Yes, my request is STAF LOCAL FS DELETE ENTRY filename RECURSE CONFIRM
Exception message:
Unhandled "Exception" condition found at end of job.
Source: throw: FrameworkException.DirectoryFailed
Info: Machine: local
RC: 20
Request: DELETE ENTRY C:(path) RECURSE CONFIRM
STAFResult: [{'staf-map-class-name': u'STAF/Service/FS/ErrorInfo', u'osRC': u'32', u'rc': u'10', u'name': u'C:\(path)\bin\Drivers\IEDriver\IEDriverServer.exe'},{'staf-map-class-name': u'STAF/Service/FS/ErrorInfo', u'osRC': None, u'rc': u'50', u'name': u'C:\(path)\bin\Drivers\IEDriver'},....]
The STAFResult shows that the FS DELETE directory request failed with STAF return code 50 (Directory Not Empty) because it got operating system return code (osRC) 32 when trying to delete file C:(path)\bin\Drivers\IEDriver\IEDriverServer.exe. You can use a "net helpmsg" command on Windows to get more information about Windows error codes (or google it):
Note: Sub-section "8.5.13 DELETE" in section "8.5 File System (FS) Service" in the STAF User's Guide at http://staf.sourceforge.net/current/STAFUG.htm#HDRFSSRV says:
For the definition of the FS/ErrorInfo map class, see "Table 15. Definition of map class STAF/Service/FS/ErrorInfo" at http://staf.sourceforge.net/current/STAFUG.htm#TBLFSERRORINFOTABLE.
How to force delete the file that is being used by another process, as this is the only way to handle my exception.
So, how to know which process is using that perticular file so that it can be kill and continue the operation with that file. Tried googleing for the solution, but no luck.
.
Last edit: Aneesh 2016-11-10
The STAF FS service's DELETE request cannot force the deletion of a file that is in use by another process.
You can google for ways to force the deletion of a file that is in use on Windows. For example, at https://www.sitepoint.com/web-foundations/force-windows-delete-file/, it talks about using the Windows del command with the /f (force) option to force the deletion of a file. For example: ‘del /f filename’. You could run this command via a <process> element in your STAX job.
You can get the name of the locked file from the STAFResult set by the <stafcmd> performing the FS DELETE request.