Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy files by date
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00736270
Message ID:
00736282
Views:
11
Hi Jos,

Thanks for the reply.

I need to copy certain files from one directory to another directory, then, I need to be able to delete files from a directory with dates older than 5 days. I am not sure that I see how ADIR() helps me do this.
If possible, could you please elaborate?

Thanks,

>Terry
>
>ADIR() will fill an array with filenames matching a file skeleton (eg *.TXT) and store file details including date and time in the array.
>
>You can then go through this array in a FOR...NEXT loop and check file dates and process accordingly.
>
>Jos
>
>
>>Hello,
>>
>>I have several .txt files in a folder. I want to copy them to another folder based on the date on the file.
>>
>>I know that I can use a command such as the following to copy all of the files from one folder to another folder:
>>
>>COPY FILE C:\FOLDER1\*.txt TO C:\FOLDER2\*.txt
>>
>>The question I have, is how do you selectively move through several files in a folder and only copy those with dates less than or equal to 5 days old.
>>
>>I also want to delete the files that are greater than 5 days old.
>>
>>The file names are programmatically created, so I do not know the file names. I only know that they are .txt files.
Thanks,

TFISHER
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform