Initialize : permission denied

Hi,
Tryin to create a file that I'll write in. The error I get is:
initialize : permission denied
I've tried all of the following
File.new("a151noplus.txt","w")
g=File.new("a151noplus.txt","w")
File.new('a151noplus.txt','w')
g=File.new('a151noplus.txt','w')

Single quotes, double quotes, hit enter while swinging a dead chicken
over my head and chanting.....no luck.

···

--
Posted via http://www.ruby-forum.com/.

Bob Miner wrote:

Hi,
Tryin to create a file that I'll write in. The error I get is:
initialize : permission denied
I've tried all of the following
File.new("a151noplus.txt","w")
g=File.new("a151noplus.txt","w")
File.new('a151noplus.txt','w')
g=File.new('a151noplus.txt','w')

Single quotes, double quotes, hit enter while swinging a dead chicken
over my head and chanting.....no luck.

Typically "permission denied" means you don't have write-access to the directory or file. Nothing to do with quoting.

···

--
RMagick: http://rmagick.rubyforge.org/

Never mind....I got it.

I needed to specify a directory, and use "/" forward slashes.

···

--
Posted via http://www.ruby-forum.com/.

Bob Miner wrote:

Tryin to create a file that I'll write in. The error I get is:
initialize : permission denied

I know this is a crazy idea, but would it by any chance be possible that you
don't have permission to write to the file?
On Windows that could be the result of the file already being opened. Or just
by you not having the required permissions on the file.

HTH,
Sebastian

···

--
Jabber: sepp2k@jabber.org
ICQ: 205544826