Rakefile under Cygwin: permission denied

J

Jim Menard

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
 
R

Robert Klemme

Jim Menard said:
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
 
J

Jim Menard

Robert said:
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
 
R

Robert Klemme

Jim Menard said:
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
 
J

Jim Menard

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... :)

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
 
N

nobu.nokada

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}
?
 
J

Jim Menard

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top