[Mongrel] file access with mongrel running as windows service

Luis Lavena luislavena at gmail.com
Wed Aug 18 13:02:10 EDT 2010


On Wed, Aug 18, 2010 at 9:47 AM, Amit Tomar <lists at ruby-forum.com> wrote:
>
> LUIS
> i am not getting error like
> Permission denied - //Z/:streams/al00_96000.aac
> what should i do and i am also running service as a particular user

I'm having problems understanding your english.

Mapped network drives do not start with //, they are normal network letters:

C:\Users\Luis>net view
Server Name            Remark

-------------------------------------------------------------------------------
\\KEORE

C:\Users\Luis>net view \\KEORE
Shared resources at \\KEORE

Share name  Type  Used as  Comment
-------------------------------------------------------------------------------
Users       Disk

C:\Users\Luis>net use * \\KEORE\Users
Drive Z: is now connected to \\KEORE\Users.

The command completed successfully.

C:\Users\Luis>irb
irb(main):001:0> require 'fileutils'
=> true
irb(main):002:0> FileUtils.touch "Z://foo.txt"
Errno::EACCES: Permission denied - Z://foo.txt
        from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1034:in
`initialize'
        from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1034:in
`open'
        from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1034:in
`touch'
        from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1028:in
`each'
        from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1028:in
`touch'
        from (irb):2

It is clear I don't have permission to do that, but:

irb(main):003:0> FileUtils.touch "Z://Luis/foo.txt"
=> ["Z://Luis/foo.txt"]

I do.

Also:

irb(main):004:0> FileUtils.touch "//Z://Luis/bar.txt"
Errno::ENOENT: No such file or directory - //Z://Luis/bar.txt
        from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1034:in
`initialize'
        from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1034:in
`open'
        from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1034:in
`touch'
        from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1028:in
`each'
        from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1028:in
`touch'
        from (irb):4

it is clear that // should not prepend the drive letter, but instead:

irb(main):005:0> FileUtils.touch "//KEORE/Users/Luis/bar.txt"
=> ["//KEORE/Users/Luis/bar.txt"]

I hope this explains a bit better what I'm talking about.
-- 
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry


More information about the Mongrel-users mailing list