ruby-ftp - directory vs file?

M

Marc Heiler

How do I find out whether "foobar" is a remote directory, or a remote
file?

I don't seem to find any trivial way to check this.
Has this maybe been forgotten?
 
M

Marc Heiler

Solved it via .list (and help of someone else)

"drwxrwxrwx 2 web netscape 8192 Oct 29 2007 images"

The first pos indicates a dir.

However I think it would be nice if the ruby ftp class could be extended
to allow easy checks like that, as does standard ruby ( i.e.
File.directory? )
 
D

David Masover

"drwxrwxrwx 2 web netscape 8192 Oct 29 2007 images"

The first pos indicates a dir.

By convention, I think. That's a Unix-style mask, as you would get
with 'ls -l'. Have you tried it on a Windows host?

I'm not sure there's anything built into the FTP protocol to show that it's a
directory.
 
M

Marc Heiler

Have you tried it on a Windows host?

No I haven't. :)

In fact I dont know of a windows ftp host at all, all the ones I worked
with are always unix-style, and for these the "ls -l" will work. I
wonder if others will also end up doing the same checks as I did, or
maybe noone else is using the ruby-ftp stuff... people should build more
ruby-GUIs, there are plenty of things one can combine into these GUIs :D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,667
Latest member
DaniloB294

Latest Threads

Top