Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to release the file after making it Read Only
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00874354
Message ID:
00874394
Vues:
24
>Hello George,
>I have a scanning program via vfp.
>
>After scanning the document i make the file read only by doing the following:
>###########################################
>IF FILE("C:\scanned2903.tif") THEN
> oFSO = CREATEOBJECT("Scripting.FileSystemObject")
> oFile = oFSO.GetFile("C:\scanned2903.tif")
> * Set the read-only bit.
> oFile.Attributes = BITOR(oFile.Attributes, 1)
>ENDIF
>###########################################
>
>And in case if i want to delete the file, It wont allow me to do that, I get a message saying "FILE IS IN USE."
>
>Is there a way i can release the oFSO.releasefile("C:\scanned2903.tif")
>
>Thank you very much.

How are you trying to delete the file? Are you using oFSO.DeleteFile or oFile.Delete? In the latter case, with a file with the Read-Only attribute set, you'd use oFile.Delete(.T.) to force the deletion.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform