troubleshooting Question

Unusual behaviour reading FILETIME attributes using FTP

Avatar of drydo
drydo asked on
Visual Basic Classic
13 Comments1 Solution215 ViewsLast Modified:
Hi Guys,

Long time reader, first time poster.

I have a rather unusual problem reading the FILETIME attributes of a file using an FTP connection (called using the wininet.dll functions).

For an utterly bizarre reason, if I FTP a file on a remote server (either using CLI FTP or BulletProof FTP) and then read and convert the FILETIME attributes of the file into a SYSTEMTIME, it is ALWAYS one year out?!?

But if I view the file using a FTP Client (e.g. BulletProof) it shows the correct date.

Even more unusual is that after one hour exactly (yes, I timed it) if I read the file again it provides the correct date?!?

For example, the following debug print shows the directory structure on the remote server but it shows the file 'main.exe' with the date/time of '09/09/01 10:53', which is correct apart from the fact it is a year out...

Filename: main.exe Date: 09/09/2001 Time: 10:53
Filename: new_BMN_Manager.exe Date: 06/09/2002 Time: 17:13
Filename: new_config.txt Date: 06/09/2002 Time: 17:13
Filename: new_debug.txt Date: 06/09/2002 Time: 17:13
Filename: new_pho1.jpg Date: 06/09/2002 Time: 17:13
Filename: new_pho2.jpg Date: 06/09/2002 Time: 17:13
Filename: new_pho3.jpg Date: 06/09/2002 Time: 17:13
Filename: new_pho4.jpg Date: 06/09/2002 Time: 17:13
Filename: new_pho5.jpg Date: 06/09/2002 Time: 17:13

...however, if run the same code an hour after the file has been uploaded (11.53) the debug results are...

Filename: main.exe Date: 09/09/2002 Time: 10:53
Filename: new_BMN_Manager.exe Date: 06/09/2002 Time: 17:13
Filename: new_config.txt Date: 06/09/2002 Time: 17:13
Filename: new_debug.txt Date: 06/09/2002 Time: 17:13
Filename: new_pho1.jpg Date: 06/09/2002 Time: 17:13
Filename: new_pho2.jpg Date: 06/09/2002 Time: 17:13
Filename: new_pho3.jpg Date: 06/09/2002 Time: 17:13

...and yes, this time it is showing the correct year.

I must admit I'm utterly baffled on this, is there some kind of caching I'm not aware of.  What is Bulletproof FTP doing that I'm not.

Anyway, thanks for reading this and if you can be of any help I will be extremely grateful.

Cheers

Drydo


ASKER CERTIFIED SOLUTION
Richie_Simonetti
IT Operations

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros