MAwiniarski wrote:
> Greetings,
>
> I want to create new file using:
>
> f = File.new('filename', 'r+')
>
> I've got following output:
>
> file.rb:lineNo:in 'initialize'
> file.rb:lineNo:in 'open'
>
> Looks like File.new (before using open method) couldn't initialize.
>
> Totally don't know what to do with it. I've got ruby installed
> properly, and everything
> works fine apart from File class    8-*
>
> THX for help
>   
% ruby -e 'open("filename", "r+")'
-e:1:in `initialize': No such file or directory - filename (Errno::ENOENT)
        from -e:1:in `open'
        from -e:1
zsh: exit 1     ruby -e 'open("filename", "r+")'

% perl -e 'open(FH, "<r+", "filename") or die("unable");'
unable at -e line 1.
zsh: exit 2     perl -e 'open(FH, "<r+", "filename") or die("unable"); '

% python -c 'open("filename", "r+")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: 'filename'
zsh: exit 1     python -c 'open("filename", "r+")'