[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

initialize : permission denied

Bob Miner

8/3/2008 8:51:00 PM

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

3 Answers

Tim Hunter

8/3/2008 9:03:00 PM

0

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.ruby...

Bob Miner

8/3/2008 9:04:00 PM

0

Never mind....I got it.

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

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

Sebastian Hungerecker

8/3/2008 9:04:00 PM

0

Bob Miner wrote:
> Tryin to create a file that I'll write in. =C2=A0The error I get is:
> initialize : permission denied

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

HTH,
Sebastian
=2D-=20
Jabber: sepp2k@jabber.org
ICQ: 205544826