Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why can't I delete a directory?
Message
De
12/06/2003 08:21:55
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
12/06/2003 08:11:35
Geert Van Snik
Zorgned Automatisering Bv
Wageningen, Pays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00799289
Message ID:
00799293
Vues:
21
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform