List Info

Thread: Dir.exist?




Dir.exist?
user name
2006-12-04 03:06:02
hi!

Wouldn't it be nice to have

   Dir.exist?('somedir')

as an alias for File.directory? It seems quite
understandable that a  
nuby in our
German forum just asked why it wasn't working.
[murphy]

Dir.exist?
user name
2006-12-04 18:17:06
Kornelius Kalnbach wrote:
> hi!
> 
> Wouldn't it be nice to have
> 
>   Dir.exist?('somedir')
> 
> as an alias for File.directory? It seems quite
understandable that a 
> nuby in our
> German forum just asked why it wasn't working.
> [murphy]

I like it personally - why not consider filing a feature
ticket with 
patch? (I remember seeing many posts here about using the
"alias" macro 
in Ruby .c source which appears simple to do)

-Nate

Dir.exist?
user name
2006-12-05 00:08:55
Hi,

At Mon, 4 Dec 2006 12:06:02 +0900,
Kornelius Kalnbach wrote in [ruby-core:09661]:
> Wouldn't it be nice to have
> 
>    Dir.exist?('somedir')
> 
> as an alias for File.directory? It seems quite
understandable that a  
> nuby in our
> German forum just asked why it wasn't working.

Also Socket.exist?, Pipe.exist?, Symlink.exist? and so on?

-- 
Nobu Nakada

Dir.exist?
user name
2006-12-05 00:24:48
> Also Socket.exist?, Pipe.exist?, Symlink.exist? and so
on?
Yes! If you work with those. Never used them before,
actually.  
Symlinks are not cross-platform.

The point is, not all programmers have the UNIXy view that  
"everything is a file".
For example, when Windows users think about their drive,
they see  
only folders and files.
And it's quite natural to end up with Dir.exists? then.

This proposal focuses on humans, not machines 
[murphy]

Dir.exist?
user name
2006-12-05 00:44:12
> Also Socket.exist?, Pipe.exist?, Symlink.exist? and so
on?
Yeah, you got me with that. There are no Pipe or Symlink
classes.

I guess it only makes sense for Dir, and maybe for Socket.
Of course, things like Sticky.exists? would be crazy.
[murphy]

Dir.exist?
user name
2006-12-07 15:52:28
Hi,

At Tue, 5 Dec 2006 09:44:12 +0900,
Kornelius Kalnbach wrote in [ruby-core:09669]:
> > Also Socket.exist?, Pipe.exist?, Symlink.exist?
and so on?
> Yeah, you got me with that. There are no Pipe or
Symlink classes.
> 
> I guess it only makes sense for Dir, and maybe for
Socket.

I've heard that Windows Vista will have symlinks.  What do
you
expect for it?

# Dir.exist? was added anyway.

-- 
Nobu Nakada

Dir.exist?
user name
2006-12-11 17:41:35
> # Dir.exist? was added anyway.
thanks!
[murphy]

[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )