Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why can't I delete a directory?
Message
From
12/06/2003 08:21:55
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
12/06/2003 08:11:35
Geert Van Snik
Zorgned Automatisering Bv
Wageningen, Netherlands
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00799289
Message ID:
00799293
Views:
20
>All,
>
>After solving the DLL puzzle (VFP goes poof upon CLEAR DLLS), that is the DLL turned out to be the troublemaker not VFP. I'm encountering a new problem.
>
>I'm storing a load of files to a temporary directory (using MKDIR). Next I zip the contents of this directory, I clear out the files and try to do a 'RMDIR C:\temp\it000003'. It fails with an access denied, in the Windows Explorer I can see that the directory is read-only.
>So it's clear why it fails, but how to get past this. It seems the 'read-only' disappears upon closing the app or vfp, but that's too late. I need it done now.
>
>The directory is empty and it's not the current directory I'm trying to delete, so what's happening here??
>Why can't I RMDIR?
>
>Thanks in advance for any suggestions.
lcMyDir = 'c:\temp\Folderxx'
SetFileAttr(lcMyDir) && Remove RO,H,S flags if any
RmDir (lcMyDir)

function SetFileAttr
lparameters tcFileName, tlReadOnly, tlHidden, tlSystem

#define FILE_ATTRIBUTE_READONLY    0x00000001  
#define FILE_ATTRIBUTE_HIDDEN      0x00000002  
#define FILE_ATTRIBUTE_SYSTEM      0x00000004  

local lnNewAttr
lnNewAttr = iif(tlReadonly,FILE_ATTRIBUTE_READONLY,0)+;
	  iif(tlHidden,FILE_ATTRIBUTE_HIDDEN,0)+;
	  iif(tlSystem,FILE_ATTRIBUTE_SYSTEM,0)
declare integer SetFileAttributes in Win32API ;
	string @ lpFileName,  integer dwFileAttributes
declare integer GetFileAttributes in Win32API ;
  string @ lpFileName
  
SetFileAttributes(@tcFilename, ;
 bitor(bitand(GetFileAttributes(@tcFilename),0xFFFFFFF8),lnNewAttr))
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform