Dir.mkdir creates a directory and returns 0 on success. It would be better if Dir.mkdir returned a new Dir object that wrapped the file descriptor that mkdir(2) returns. My immediate use case is that this would allow you to create temporary directories as safely as files can currently be created. I'll gladly write the patch (and even more gladly let someone else do it for me), but I would like input on this before I do. Thanks!
on 24.04.2008 14:42
on 25.04.2008 06:03
Nikolai Weibull wrote: > Thanks! > Feel free to post that patch, but also note that: (1) We already have Dir.mktmpdir once you require 'tmpdir' (2) Don't forget Windows and other systems which don't have file descriptors.
on 25.04.2008 06:41
Hi, At Fri, 25 Apr 2008 13:03:08 +0900, Urabe Shyouhei wrote in [ruby-core:16584]: > > Thanks! > > > > Feel free to post that patch, but also note that: > (1) We already have Dir.mktmpdir once you require 'tmpdir' > (2) Don't forget Windows and other systems which don't have file > descriptors. All systems have or emulate file descriptors and Shyouhei meant the systems which mkdir(2) doesn't return a file descriptor. I've not seen nor heared yet about such systems, mkdir(2) opens the created directory togegher, though.