[Q]How do one determine if a ftp link is to a directory or a file ?

Bert Freudenberg bert at isg.cs.uni-magdeburg.de
Tue Jul 29 08:56:54 UTC 2003


Am Dienstag, 29.07.03 um 10:41 Uhr schrieb Avi Bryant:

>
> On Tue, 29 Jul 2003, Karl Ramberg wrote:
>
>> 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 ?
>
> The obvious clue there is the size, which is 0 for the directory and 
> not
> for the file.  Not a sure indication but might be helpful... ?

The size is 5 because there are 5 characters in '.pub1'. Not sure what 
the 0 and 1 are, but my buest guess would be uid and gid.

I think you will have to follow the symlink to see what it is.

-- Bert



More information about the Squeak-dev mailing list