Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing the Date Modified
Message
From
06/08/2003 02:36:53
 
 
To
06/08/2003 01:07:32
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00816965
Message ID:
00817183
Views:
16
This message has been marked as the solution to the initial question of the thread.
>Hello Gregory,
>
>Thanks for the help. I believe I have part of it:
>
>gnPDFnumber = ADIR(NEWPDFS,"E:\CVS3\PDFS\*.PDF")
>*
>CLEAR
>FOR nCount = 1 TO gnPDFnumber && Loop for number of PDF files
> COPY FILE "e:\cvs3\pdfs\"+NEWPDFS(nCount,1) TO "e:\cvs3\uploadPDFs\"+NEWPDFS(nCount,1) FOR NEWPDFS(nCount,3)= CTOD("5/30/2003")
>ENDFOR
>*
>
>BUT the "FOR...." part does not work in a COPY FILE command. And I don't believe it is valid for the ADIR command either.
>
>The app. is that the staff will be scanning in several hundred .pdfs a day.
>I want to upload those scanned today to a web site. Actually I want to copy them to another subdirectory, the contents of which will be uploaded.
>
>Any more help as to how I can copy only files with a certain date range? TIA.
>
>
>Regards,
>
>Paige

Paige,

No, the 'copy file'does not have a for clause. But we can get around that
DateFrom = date(2003,5, 30)
DateTo = date(2003, 5, 30)

FolderFrom = 'E:\CVS3\PDFS\'
FolderTo = 'e:\cvs3\uploadPDFs\'

gnPDFnumber = ADIR(NEWPDFS,FolderFrom + "*.PDF")
FOR nCount = 1 TO gnPDFnumber
    
    FileName = NEWPDFS[nCount, 1]
    FileModDate =  NEWPDFS[nCount, 3]
    && between
    do case
    case !between(FileModDate, DateFrom, DateTo)
        && do nothing

    otherwise
        copy file (FolderFrom + FileName) to (FolderTo + FileName)
 
    endcase
endfor
As to the several hundred .pfds, there is a limit of 13000 (65000/5) file entries. Either move the source files from time to time, or do this for files starting with a, b, .... or else, sys(2000) has no limits but you will have to get the filemoddate with fdate()
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform