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:45:07
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
12/06/2003 08:21:55
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00799289
Message ID:
00799301
Vues:
25
Cetin,

What if the directory is not empty?

Renoir


>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform