[Q]How do one determine if a ftp link is to a directory or a
file?
Karl Ramberg
karl.ramberg at chello.se
Tue Jul 29 19:50:24 UTC 2003
Thanks for the code. I'll see what I can get out it.
Thanks to all who replied to my question.
Karl
Alexander LazareviÊ wrote:
>
> Hi Karl!
>
> The output format of the list command varies with ftp servers. I once used the
> attached files as a quick and dirty solution. The author claims to handle
> output for the following servers:
>
> EPLF.
> UNIX ls, with or without gid.
> Microsoft FTP Service.
> Windows NT FTP Server.
> VMS.
> WFTPD.
> NetPresenz (Mac).
> NetWare.
> MSDOS.
>
> I created a shared library and called the function ftpparse from smalltalk
> with ever line of output produced by a list command. The structure ftpparse
> you get back contains a 1 in flagtrycwd, if a cwd is worth to try (directory,
> link to dir) or a 0 if not (file, link to file).
>
> I used this to have something up and running in no time. Doing something
> similiar in Smalltalk should be no problem and maybe the attached files can
> help you in doing so.
>
> Alex
>
> Am Dienstag, 29. Juli 2003 10:15 schrieb Karl Ramberg:
> > How do one determine if a link in a ftp server is a link to a directory
> > or a file ?
> > Just looking at the returned ftp entry answers these strings, first one
> > a file,
> > second a directory:
> >
> >
> > 'lrwxrwxrwx 1 1137 1100 36 Apr 12 07:12
> > SqueakV3.sources.gz -> ../sources_files/SqueakV3.sources.gz'
> > 'lrwxrwxrwx 1 0 1 5 Apr 24 11:15 pub -> .pub1'
> >
> >
> >
> > Do one have to follow the link and the see if it returns a directory or
> > file, or can
> > one get the info just from the returned string ?
> >
> > Karl
>
> --
> Holland klagt über Rattenplage aus Deutschland: "Aus Deutschland sind so viele
> Ratten nach Holland abgewandert hier in Köln-Mülheim stehen schon die
> ersten Häuser leer." -- Harald Schmidt
>
> ------------------------------------------------------------------------
> Name: ftpparse.c
> ftpparse.c Type: text/x-csrc
> Encoding: 7bit
>
> Name: ftpparse.h
> ftpparse.h Type: text/x-chdr
> Encoding: 7bit
>
> ------------------------------------------------------------------------
More information about the Squeak-dev
mailing list
|