ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Lévy-Lambert <anto...@antbuild.com>
Subject WG: ant FTP task: pb with date handling
Date Mon, 20 Oct 2003 11:06:31 GMT

Hi commons-user,

the ant ftp task is based on commons-net.

Is it possible to build into commons-net support for French locale directory
listings (so that dates and times are recognized).

Or is it supposed to be already there ???

Cheers,

Antoine
-----Ursprüngliche Nachricht-----
Von: laurent.izac@mpsa.com [mailto:laurent.izac@mpsa.com]
Gesendet: Montag, 20. Oktober 2003 10:58
An: dev@ant.apache.org
Betreff: ant FTP task: pb with date handling






Hi,

> *Warning: * there have been problems reported concerning the ftp get
> with newer attribute. Problems might be due to format of ls -l differing
> from what is expected by commons-net, for instance due to specificities
> of langage used by the ftp server in the directory listing. If you
> encounter such a problem, please send an email including a sample
>directory listing coming from your ftp server (ls -l on the ftp prompt).
>
> dev@ant.apache.org <mailto:dev@ant.apache.org>
>

This mail to let you know about the exotic ftp configuration I'm confronted
with
and that Ant doesn't handle well, as far as date checking is concerned
(depends or newer attribute).


The FTP servers we use are hosted by a french AIX 4.3.

Below is a sample ls -l on one of these FTP servers.

ftp> ls -l
200 PORT command successful.
150 Opening data connection for /bin/ls.
total 24
-rw-r--r--   1 wnsiduk  www           65 13 mar 2003  adviser.out
-rwxr-xr-x   1 wnsiduk  www           65 16 mai 2002  cnx.sh
-rw-r--r--   1 wnsiduk  www         1541 10 oct 16:47 smit.log
-rw-r--r--   1 wnsiduk  www            0 21 fév 2003  smit.script
226 Transfer complete.


I'm not ready to propose any patch yet, as I don't master Java well enough,
but I can suggest a way of handling such situations.
I found this in TotalCommander (a file manager for Windows, and much more).

Below is a template definition I created for  TotalCommander to let it
display and sort files on date/time according to our exotic FTP listings:

Template1=pppppppppp                     !S*
TTT=janfévmaravrmaijunjulaoûsepoctnovdéc DD UUUUU n*

This template (see below for format definition) describes a listing
produced by an FTP server on a french AIX 4.3 we have.

Hoping this can help, I thank you for the tremendous work achieved so far
on Ant.
--
Laurent IZAC


----------------------------------------------------------------------------
----------------------------------
Extracted from TotalCommander online help :

[...]
List of definition characters (upper/lowercase is important!):

Name-specific characters:

n    File name (nnnnnnnn means 8 letter file name, n* see definition of *
below)

v    VMS style file name: name.ext;1 or dirname.dir;1
. (a dot) Remove trailing spaces from file name and append further
characters separated by a dot (e.g. nnnnnnnn.nnn), see PC-NFSD sample
below.

Characters for date and time:
D    Day
M    Month
TTT  Three letter month name (Jan, Feb, Mar, ...), supports English, German
and French.
TTT=12 month names with 3 letters each
Allows the definition of foreign language month names. Example (polish):
TTT=stylutmarkwimajczelipsiewrzpa¥lisgru

UUUUU     Unix-style year/time mix, e.g. either "2000 " or "20:30" in the
same place
Y    Year
h    Hours
H    Hours modifier letter (a - a.m. time, p - p.m. time)
m    Minutes
s    Seconds

Characters for other file attributes:
S    Size
S=1024    Size multiplied with given value (here: 1024). Useful for servers
which return the size in blocks.
p    Unix style permissions (e.g. -rwxrwxrwx, defines user rights)

d    dir flag, defines a directory if this char is D or d, e.g. part of
text <DIR> or [DIR]
d=x  dir flag, the char defining a directory is given behind the = (see VOS
sample below)

Misc. characters:
*    1. After any numeric field: use all digits up to first non-digit
character
     2. For name field not at line end: use all chars up to next space
     3. For name field at line end: use all chars until the end of the line
!    Skip all characters until first space or end of line

$    Skip all spaces/tabstops until next character or end of line
\    Data continues on next line (max. 2 lines supported)
<space>   Ignore character. Must not be at the beginning of a line, because
Windows would delete all leading spaces!
-    (dash) Ignore character. Use this at the beginning of a line instead
of a space.
x    Exaclty 1 space. If there is a different character at this position,
ignore the whole line (e.g. to ignore lines above or below the file
listing, which show the free disk space etc).

Sample definition strings:

1. AIX Unix server:
Sample listing:

-rw-rw-r--   1 dso      posgroup    2913 Mar 25 1999  .Xdefaults

drw-rw-r--   1 dso      posgroup    2913 Mar 25 13:30 subdir1
Definition string:

pppppppppp                       SSSSSSS TTT DD UUUUU n*

Or better:

pppppppppp                     !S* TTT DD UUUUU n*

Notes: The second definition is better because the owner and group names
may be longer, moving the size string to the right.

2. PC-NFSD:
Sample listing:

prog1    exe     2,563,136 06-10-99  10:00a
temp         <dir>         01-27-97   3:41p

Definition string:

nnnnnnnn.nnn  dSSSSSSSSSSS MM DD YY  hh mmH

Notes: The commas in numeric fields are detected automatically. This string
gives an error of 1 for all directories because there is no size field, but
errors up to 2 are ignored by Total Commander if there is no second
definition string - otherwise the string giving the smaller error is used.
The dot in the definition string removes the spaces in the name between
prog1 and exe
, and inserts a dot.

3. VOS (Stratus):
Sample listing:

 w     10  seq       99-04-20 11:15:42  abbreviations
 m      4  99-07-02 10:11:25  arsffs32

Definition strings:

-   SSSSS            YY MM DD hh mm ss  n*
- d=  SSSSS  YY MM DD hh mm ss  n*
Notes: This server has different lines for files and folders, so it needs 2
definition strings.

4. Unisys Clearpath:
Sample listing:

UCF/CONFIG/SAMPLE/TSA             SEQDATA            1428 09/22/1998 18:37

FF990628/BD/0009942/0009943/000PRINT
                                  BACKUPPRINTER      7200 01/01/2000 04:22
Definition strings:

nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn               SSSSSSSSS MM DD YYYY hh mm
n*\x                                               SSSSSSSSS MM DD YYYY hh
mm

Notes: This is an example of a server wrapping to 2 lines if file name
becomes too long, so it needs 2 definition strings.
[...]
----------------------------------------------------------------------------
----------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message