Sitecopy, ssh and the format of the timestamp

Gustaf Mossakowski mossakowski at caad.arch.rwth-aachen.de
Thu Oct 29 07:25:33 EDT 2009


Hello,

I'm using sitecopy for ftp and for ssh file transfers. It has become  
an indispensable tool for me, thank's a lot to Joe and the other  
authors for programming it!

Recently, I ran into troubles using sitecopy with ssh - the remote  
sites all have a different date format for the timestamps of the  
remote files. E. g. '2005-06-02 12:31' instead of the common 'Jun 02    
12:31' or similar. With the remotely installed locales, it seems  
impossible to get the old common date format back.

With 'ssh -l username 2>/dev/null host ls -la /directory' ssh does not  
establish a normal ssh connection but a connection without  
parsing .profile or .bashrc instead. So a setting in the .profile like

alias ls='ls --color=auto --time-style=+"%b %_d %H:%M" -l'

does not work since it is not parsed.

I had a look into the sources, unfortunately I don't know C. In  
sitecopy-0.16.6/src/lsparser.c I found in line 168 of function  
parse_file

     /* skip Month, day, time fields */
     line = skip_field(skip_field(skip_field(line)));

So I assume that sitecopy only skips the timestamp and expects three  
tokens. Changing the line to

     line = skip_field(skip_field(line));

makes sitecopy work perfectly well with sites with timestamps in the  
more ISO-like '2005-06-02 12:31'-format. Unfortunately, of course this  
causes sitecopy to fail on the other sites ...

Instead of keeping to sitecopy-binaries in place, my question is:  
would it be possible to either parse the timestamp or have some switch  
to change the parsing behaviour in future sitecopy releases (if they  
are planned)?

Best regards,
Gustaf




More information about the sitecopy mailing list