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?
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?
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? )
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
On Wednesday 04 June 2008 15:14:56 Marc H. wrote:
“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.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs