Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ftp dir not returning date/time consistantly 1

Status
Not open for further replies.

ThatRickGuy

Programmer
Oct 12, 2001
3,841
US
Hi everyone, I'm not sure if this is the best forum for this, but my Unix knowledge is rather limited. I ran into a problem this morning with a number of automated processes that pull files off of a Unix server via FTP. Before downloading the files, they check the mod date to make sure it is newer than yestarday. Some of these files are showing up with out the year in the time stamp (they show either Mon dd hh:MM or Mon dd YYYY). Is there anyway to force the server to return full date/time stamps when anyone uses the Dir command? or some way to do it for a specific FTP session?

I can change the date parsing in the code of our automated processes, but I'd rather avoid date kludge fixes and a deployment of these applications.

Thanks,
-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
The behaviour of the 'dir' command in ftp is dependent on the ftp server at the other end, i.e. the Unix end, and this can vary.
On my AIX systems the 'dir' command returns the same info as the unix command 'ls -al'. The default for 'ls -al' under AIX is to return the timestamp as
Mon dd yyyy for files over six months old
Mon dd hh:mm for files under six months old

In short it looks like this behaviour is linked to the underlying operating system and not easily changed.

I'm not sure there's an easy answer. If you have ssh available on the Unix server you might want to look at utilities like 'plink' (part of the PuTTY family) which would allow you to run Unix commands from the Windows shell. However, looking at what you have achieved so far, it's too much solution for the problem.

Ceci n'est pas une signature
Columb Healy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top