sparge
Joined: 11 Apr 2005 Posts: 371
|
Posted: Thu Sep 07, 2006 3:30 am Post subject: File delete under WinXP |
|
|
Is there any prospect of system routines like erase@ being "modernised" to cope with the advent of WinXP? Or a FORTRAN 90 standard way to achieve the same thing, that I am not aware of? I have a number of applications that make use of this routine, and it only works under WinXP when run by someone with admin rights. Most commonly, these applications are maintaining an ini file and its previous incarnation, so that every time a setting gets changed, the previous incarnation gets erased, the current ini file becomes the previous incarnation, and a new ini file is born. |
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Thu Sep 07, 2006 7:10 am Post subject: File delete under WinXP |
|
|
Andy
erase@ makes a call to the Windows API function BOOL DeleteFile(LPCTSTR lpFileName).
This will fail if the file has read access, if the file is open or if the user does not have delete access.
The error code in erase@ is the code returned by GetLastError() after the call to DeleteFile.
If this information does not help you to fix the problem and you can find an API function (such as SHFileOperation) that does what you want then we could provide a simple interface and put it in the library.
I do not think SHFileOperation will help you with your problem but I think it does have the advantage that it allows the programmer to use the Recycle bin.
|
|