Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Safe directory delete
Message
De
04/01/2009 20:47:26
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
04/01/2009 11:19:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01370874
Message ID:
01370927
Vues:
12
Well, then, before deleting individual files, check that you are in the correct folder. Or include the folder name in the delete command, something like this:
lcFolder = c:\MyTempFiles\"
* lcFile obtained from adir()
delete (lcFolder + lcFile)
Or use one of the methods to delete the entire temp folder, for example, WSH, Windows API, or some old-fashioned RUN with a DOS command.

>OK
>I will explain
>(sorry on my poor english).
>
>Its not tmp fox files.
>I scan pictures by scanner, the scanner save it in local PC on c:\tmppci1 folder with random names (i1,i2\i3..).
>In scanner PC I created two folders c:\tmppic1 and c:\tmppic2.
>I control the user procces as following:
>1. delete all files in c:\tmppic1.
>2. insert [start\end\range] of pictures that you want to scan (with my checkdigit control).
>3. start scan
>The user press on the scanner and the scanner starting to copy duplex pictures to c:\tmppic1.
>4. delete all files in c:\tmppic2.
>5. Copy the pictures from c:\tmppic1 to c:\tmppic 2 and rename the files according my
>requirement (the scanner scan the picture one by one and I can know the content for each by files count, so I must delete the tmppic files).
>6. open new form with grid (base tmppic2 names) and picture
>7. the user will move down on the grid to check unexpected problem.
>8. The user will save the pictures to my real data.
>9. delete all tmppic\1 folders content.
>
>
>>Chaim,
>>
>>you can use sys(2023) to find the location of the tmp folder and you may specify them on your own pc in the main menu Tools -> Options -> locate for the FileLocations tab and look for TemporaryFiles.
>>
>>My curiosity? Why do you want to delete at the startup the tmp files? By default VFP deletes all the tmp files on shutdown. Only on occasions of on abnormal shutdown. powerfailure etc. some tmp files may reside.
>>Regards,
>>
>>Koen
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform