Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting a directory of files
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00932927
Message ID:
00932943
Views:
20
How about something like:
lcPath = addbs(sys(5)+curdir()) + "CIS\" + addbs(thisdir)
lnRetVal = adir(laFiles, lcPath + "*.*")
for lnI = 1 to lnRetVal
    lcFile = lcPath + laFiles[lnI, 1]
    if directory(lcFile)
       loop
    endif
    lnHandle = fopen(lcFile, 12)
    fclose(lnHandle)
    if lnHandle > 0
       erase (lcPath + lcFile)
    endif
endfor
>Hi,
>
>I am using the following statement to delete files in a directory prior to removing the directory (contains Excel and PDF files)
>
>DELETE FILES sys(5)+curdir()+"\CIs\"+thisdir+"\*.*
>
>How do I test to see if any of the files in the directory are open before I attempt to delete them ?
>
>Thanks in advance
>Carmel
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform