Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FTP Class
Message
From
07/12/2005 14:18:09
 
 
To
07/12/2005 04:07:27
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01075601
Message ID:
01075829
Views:
21
>Hi, Im trying to use a Robert Abram's FTP server class I got from the 'downloads' section. I need Date and Time of file, but I have a file create today (12/07/2005) and GetFTPDirectoryArray return the date 12/07/2004. Can you help me with that?
>
>Andrei

Andrei,

That is due to the time difference. If you wait a couple of hours, it will be ok

Ftp servers, as far as I know, list the file in unix format

The filetime of a recent file is listed as: mmm dd hh:mm
-rw-r--r--   1 551      100       5098196 Dec  4 19:17 Adam.exe
The filetime of an older file is listed as: mmm dd yyyy
-rw-r--r--   1 551      100         18841 Jan 27  2005 Adam.htm
If the time of the ftp server is ahead (clock or timezone), then there may be a problem interpreting the date

eg file time server: 12/07/2005 10:30

the time on my computer is: 12/07/2005 10:00

I get "dec 07 10:30" back

I suspect that ftp decides that future files are not possible, hence it will give a datetime of 12/07/2004 10:30


One thing you can do is to define a DangerDate
&& this is not entirely correct, consider timezone differences of hours and an hour before/after midnight
DangerDate = gomonth(dare(), -12)
If the datepart of a file is equal to the DangerDate, then you have to send a mdtm command to the ftp server, and wait for its return
&& done by hand.  Compare with the older file above
ftp> cd html
250 CWD command successful
ftp> quote mdtm Adam.htm
213 20050127101204
20050127101204 = 2005 jan 27 10:12:04
I have ftp'ed a file to 2 different ftp servers and the first gave the exact time while the second gave an hour earlier

You may need to create/transfer a file to the remote site, query its time with mdtm and delete it

If you compare the time you sent the file with the time mdtm tells, you have an Offset which you can apply to all (except the dangerdates)


You could of course, mdtm all files
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform