[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

File class doesn't work!

Daniel Carrera

10/27/2003 10:37:00 PM

Something is severely broken with my installation:

$ ls *.xml
context.xml
$ ruby -e 'puts File.exists?("content.xml")'
false
$


I just moved my ~/lib/ruby diectory some place else and re-installed Ruby
from scratch again. I still get the same problem.

Can anyone fanthom why something as basic as the File class could fail to
work on a fresh installation?

I am completely at a loss here. And naturally I can't use Ruby at all
because some of the basic funtionality I need (File and REXML) don't work.

Best,
Daniel.

6 Answers

Hal E. Fulton

10/27/2003 10:54:00 PM

0

Daniel Carrera wrote:
> Something is severely broken with my installation:
>
> $ ls *.xml
> context.xml
> $ ruby -e 'puts File.exists?("content.xml")'
> false
> $

Isn't it "exist?" rather than "exists?"?

Hal


mike

10/27/2003 10:57:00 PM

0

In article <20031027223715.GD8010@math.umd.edu>,
Daniel Carrera <dcarrera@math.umd.edu> wrote:
>Something is severely broken with my installation:
>
>$ ls *.xml
>context.xml

conte>>>x<<<t.xml

>$ ruby -e 'puts File.exists?("content.xml")'

conte>>>n<<<t.xml

>false
>$

maybe?

Hope this helps,

Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co... | GPG PGP Key 1024D/059913DA
mike@exegenix.com | Fingerprint 0570 71CD 6790 7C28 3D60
http://www.exe... | 75D2 9EC4 C1C0 0599 13DA

gabriele renzi

10/27/2003 10:58:00 PM

0

il Tue, 28 Oct 2003 07:37:20 +0900, Daniel Carrera
<dcarrera@math.umd.edu> ha scritto::

>Something is severely broken with my installation:
>
>$ ls *.xml
>context.xml
>$ ruby -e 'puts File.exists?("content.xml")'
>false
>$

context != content :)


Daniel Carrera

10/27/2003 10:58:00 PM

0

On Tue, Oct 28, 2003 at 07:53:57AM +0900, Hal Fulton wrote:

> >$ ls *.xml
> >context.xml
> >$ ruby -e 'puts File.exists?("content.xml")'
> >false
> >$
>
> Isn't it "exist?" rather than "exists?"?

They both exist =)
And they both give the same result.

$ ruby -e 'puts File.methods' | grep 'exist'
exist?
exists?
$ ruby -e 'puts File.exists?("content.xml")'
false
$ ruby -e 'puts File.exist?("content.xml")'
false
$ ls context.xml
context.xml


=(


--
Daniel Carrera | OpenPGP KeyID: 9AF77A88
PhD grad student. |
Mathematics Dept. | "To understand recursion, you must first
UMD, College Park | understand recursion".

Hal E. Fulton

10/27/2003 11:02:00 PM

0

Daniel Carrera wrote:
> On Tue, Oct 28, 2003 at 07:53:57AM +0900, Hal Fulton wrote:
>
>
>>>$ ls *.xml
>>>context.xml
>>>$ ruby -e 'puts File.exists?("content.xml")'
>>>false
>>>$
>>
>>Isn't it "exist?" rather than "exists?"?
>
>
> They both exist =)
> And they both give the same result.
>
> $ ruby -e 'puts File.methods' | grep 'exist'
> exist?
> exists?
> $ ruby -e 'puts File.exists?("content.xml")'
> false
> $ ruby -e 'puts File.exist?("content.xml")'
> false
> $ ls context.xml
> context.xml

Ahhh.

'context' != 'content'

Hal


Daniel Carrera

10/27/2003 11:07:00 PM

0

On Tue, Oct 28, 2003 at 08:02:14AM +0900, Hal Fulton wrote:

> > $ ls context.xml
> >context.xml
>
> Ahhh.
>
> 'context' != 'content'


Okay, I am oficially dyslexic. This isn't the first time I confuse two
symilar-sounding English words.

Thank you for your patience. Yes, "context.xml" does exist.

Cheers,
--
Daniel Carrera | OpenPGP KeyID: 9AF77A88
PhD grad student. |
Mathematics Dept. | "To understand recursion, you must first
UMD, College Park | understand recursion".