[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

File.link() error message

aslowloris)lorisx(with)

6/12/2005 3:20:00 AM

Why does File.link() report that the source file exists? It really
ought to only report that the destination file exists. It isn't an
error for the source to exist. If it didn't, we'd get ENOENT, not
EEXIST.

irb(main):018:0> File.open("foop", "w") {}
=> nil
irb(main):019:0> File.open("barp", "w") {}
=> nil
irb(main):020:0> File.link("foop", "barp")
Errno::EEXIST: File exists - foop or barp
from (irb):20:in `link'
from (irb):20
from :0

-Loris
2 Answers

Ara.T.Howard

6/12/2005 6:31:00 PM

0

Yukihiro Matsumoto

6/12/2005 7:09:00 PM

0

Hi,

In message "Re: File.link() error message"
on Sun, 12 Jun 2005 12:25:30 +0900, lorisx@gmail.com (a slow loris) (with) (poison)
(elbows) writes:

|Why does File.link() report that the source file exists? It really
|ought to only report that the destination file exists. It isn't an
|error for the source to exist. If it didn't, we'd get ENOENT, not
|EEXIST.

I guess it's a matter of description.

"Errno::EEXIST: File exists - foop or barp" means that an EEXIST error
happened either for foop or barp. But I don't want to treat every
kind of system call errors individually.

If you (or anyone else) have any suggestion for better description, we
are always open.

matz.