Rakefile under Cygwin: permission denied

Discussion in 'Ruby' started by Jim Menard, Jun 14, 2004.

  1. Jim Menard

    Jim Menard Guest

    The Rakefile

    task :default => ['foo/bar']

    directory 'foo'

    file 'foo/bar' => ['foo'] do
    sh 'touch foo/bar'
    end

    fails if both the directory 'foo' and the file 'bar' within it exist.

    c:/cygwin/tmp/> rake
    (in c:/cygwin/tmp)
    rake aborted!
    Permission denied - foo
    c:/cygwin/tmp/>

    As you can see from the command prompt, this is under Cygwin.

    Am I doing something wrong?

    Jim
    --
    Jim Menard, , http://www.io.com/~jimm/
    "Congratulations are in order for Tom Reid. He says he just found out he is
    the winner of the 2021 Psychic of the Year award." -- Seen on slashdot
     
    Jim Menard, Jun 14, 2004
    #1
    1. Advertising

  2. "Jim Menard" <> schrieb im Newsbeitrag
    news:...
    > The Rakefile
    >
    > task :default => ['foo/bar']
    >
    > directory 'foo'
    >
    > file 'foo/bar' => ['foo'] do
    > sh 'touch foo/bar'
    > end
    >
    > fails if both the directory 'foo' and the file 'bar' within it exist.
    >
    > c:/cygwin/tmp/> rake
    > (in c:/cygwin/tmp)
    > rake aborted!
    > Permission denied - foo
    > c:/cygwin/tmp/>
    >
    > As you can see from the command prompt, this is under Cygwin.
    >
    > Am I doing something wrong?


    Did you verify that the commands work from the prompt? Otherwise I'd
    suspect a permissions problem.

    Regards

    robert
     
    Robert Klemme, Jun 14, 2004
    #2
    1. Advertising

  3. Jim Menard

    Jim Menard Guest

    Robert Klemme writes:

    > Did you verify that the commands work from the prompt? Otherwise I'd
    > suspect a permissions problem.
    >


    This is Windows XP and my login has admin privileges: what permissions? :)

    Actually, what's failing is deep inside rake. Its "timestamp" method calls

    File.new(name.to_s).mtime

    but the "File.new('foo/bar')" is what fails with the "permission denied"
    error. When I do "ls -l" (I'm using Cygwin)

    ~> ls -l foo
    total 0
    -rw-rw-rw- 1 JMenard 5 0 Jun 14 09:32 bar
    ~> ls -l foo/bar
    -rw-rw-rw- 1 JMenard 5 0 Jun 14 09:32 foo/bar

    Jim
    --
    Jim Menard, , http://www.io.com/~jimm/
    "My parents just came back from a planet where the dominant lifeform
    had no bilateral symmetry, and all I got was this stupid F-Shirt."
    -- .sig of Paul Archer
     
    Jim Menard, Jun 14, 2004
    #3
  4. "Jim Menard" <> schrieb im Newsbeitrag
    news:...
    > Robert Klemme writes:
    >
    > > Did you verify that the commands work from the prompt? Otherwise I'd
    > > suspect a permissions problem.
    > >

    >
    > This is Windows XP and my login has admin privileges: what permissions?

    :)

    As far as I know the complicated rights management of Win / NTFS I suspect
    it is possible to reject permissions even for admins. So, this is an
    option... :)

    > Actually, what's failing is deep inside rake. Its "timestamp" method

    calls

    Then maybe you should post a stack trace to aid in Rake debugging.

    Kind regards

    robert
     
    Robert Klemme, Jun 14, 2004
    #4
  5. Jim Menard

    Jim Menard Guest

    Robert,

    > As far as I know the complicated rights management of Win / NTFS I suspect
    > it is possible to reject permissions even for admins. So, this is an
    > option... :)
    >
    > > Actually, what's failing is deep inside rake. Its "timestamp" method

    > calls
    >
    > Then maybe you should post a stack trace to aid in Rake debugging.


    Good point.

    rake --trace
    (in c:/jmenard)
    ** Invoke default (first_time)
    rake aborted!
    Permission denied - foo
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.3.2/lib/rake.rb:263:in `initialize'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.3.2/lib/rake.rb:263:in `new'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.3.2/lib/rake.rb:263:in `timestamp'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.3.2/lib/rake.rb:256:in `needed?'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.3.2/lib/rake.rb:256:in `collect'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.3.2/lib/rake.rb:256:in `needed?'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.3.2/lib/rake.rb:107:in `trace_flags'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.3.2/lib/rake.rb:95:in `invoke'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.3.2/lib/rake.rb:99:in `invoke'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.3.2/lib/rake.rb:99:in `each'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.3.2/lib/rake.rb:99:in `invoke'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.3.2/lib/rake.rb:862:in `run'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.3.2/lib/rake.rb:862:in `each'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.3.2/lib/rake.rb:862:in `run'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.3.2/bin/rake:7
    /ruby/bin/rake:12:in `load'
    /ruby/bin/rake:12


    Jim
    --
    Jim Menard, , http://www.io.com/~jimm/
    "I can picture in my mind a world without war, a world without hate. And I
    can picture us attacking that world, because they'd never expect it."
    -- Jack Handey
     
    Jim Menard, Jun 14, 2004
    #5
  6. Jim Menard

    Guest

    Hi,

    At Mon, 14 Jun 2004 22:32:13 +0900,
    Jim Menard wrote in [ruby-talk:103498]:
    > Actually, what's failing is deep inside rake. Its "timestamp" method calls
    >
    > File.new(name.to_s).mtime


    Why it's not
    File.mtime(name)
    or
    File.open(name){|f| f.mtime}
    ?

    --
    Nobu Nakada
     
    , Jun 14, 2004
    #6
  7. Jim Menard

    Jim Menard Guest

    writes:
    > Hi,
    >
    > At Mon, 14 Jun 2004 22:32:13 +0900,
    > Jim Menard wrote in [ruby-talk:103498]:
    > > Actually, what's failing is deep inside rake. Its "timestamp" method calls
    > >
    > > File.new(name.to_s).mtime

    >
    > Why it's not
    > File.mtime(name)
    > or
    > File.open(name){|f| f.mtime}
    > ?


    I don't know why. File.mtime(name.to_s) works.

    I've CC'd rake-devel. Consider this a change request: Please change the
    implementation of timestamp to be

    File.mtime(name.to_s)

    because under XP, the current implementation

    File.new(name.to_s).mtime

    fails if name already exists due to a "ERRNO::EACCESS: Permission denied"
    error.

    Jim
    --
    Jim Menard, , http://www.io.com/~jimm/
    "Eating kittens is just plain ... plain wrong! And no one should do it, ever!"
    -- The Tick
     
    Jim Menard, Jun 14, 2004
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    515
  2. Elmar Hinz
    Replies:
    0
    Views:
    351
    Elmar Hinz
    Aug 23, 2010
  3. Elmar Hinz
    Replies:
    0
    Views:
    334
    Elmar Hinz
    Aug 23, 2010
  4. John Gabriele
    Replies:
    1
    Views:
    179
    Suraj Kurapati
    Dec 5, 2006
  5. Ronald Fischer
    Replies:
    1
    Views:
    175
    Ronald Fischer
    Jun 18, 2007
Loading...

Share This Page