1 |
/* Get a directory listing using the ftp protocol |
/* Get a directory listing using the ftp protocol |
2 |
|
|
3 |
Copyright (C) 1997 Free Software Foundation, Inc. |
Copyright (C) 1997,2002 Free Software Foundation, Inc. |
4 |
|
Written by Miles Bader <miles@gnu.org> |
|
Written by Miles Bader <miles@gnu.ai.mit.edu> |
|
5 |
|
|
6 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
7 |
modify it under the terms of the GNU General Public License as |
modify it under the terms of the GNU General Public License as |
36 |
{ |
{ |
37 |
{"user", 'u', "USER",0, "User to login as on ftp server"}, |
{"user", 'u', "USER",0, "User to login as on ftp server"}, |
38 |
{"password", 'p', "PWD", 0, "USER's password"}, |
{"password", 'p', "PWD", 0, "USER's password"}, |
39 |
{"account", 'a', "ACCT",0, "Account to login as"}, |
{"account", 'a', "ACCT",0, "Account to login as"}, |
40 |
{"separator",'S', "SEP", 0, "String to separate multiple listings"}, |
{"separator",'S', "SEP", 0, "String to separate multiple listings"}, |
41 |
{"prefix", 'P', "PFX", 0, "String to proceed listings; the first and second" |
{"prefix", 'P', "PFX", 0, "String to proceed listings; the first and second" |
42 |
" occurances of %s are replace by HOST and DIR"}, |
" occurances of %s are replace by HOST and DIR"}, |
202 |
{ |
{ |
203 |
char timebuf[20]; |
char timebuf[20]; |
204 |
strftime (timebuf, sizeof timebuf, "%Y-%m-%d %H:%M", localtime (&st->st_mtime)); |
strftime (timebuf, sizeof timebuf, "%Y-%m-%d %H:%M", localtime (&st->st_mtime)); |
205 |
printf ("%6o %2d %5d %5d %6ld %s %s\n", |
printf ("%6o %2d %5d %5d %6lld %s %s\n", |
206 |
st->st_mode, st->st_nlink, st->st_uid, st->st_gid, st->st_size, |
st->st_mode, st->st_nlink, st->st_uid, st->st_gid, st->st_size, |
207 |
timebuf, name); |
timebuf, name); |
208 |
if (symlink_target) |
if (symlink_target) |
222 |
return err; |
return err; |
223 |
} |
} |
224 |
|
|
225 |
int |
int |
226 |
main (int argc, char **argv) |
main (int argc, char **argv) |
227 |
{ |
{ |
228 |
struct ftpdir_host *hosts = 0; |
struct ftpdir_host *hosts = 0; |