[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "losing" a file in the ext2 file-system
In message <3.0.1.32.19970715181202.006ad9b4@dns.slink.co.il> you write:
|>You are not supposed to be able to write(2) to a directory. I don't
|>have joe to test this, and the editors I do have do not even try
|>to touch the directory. "cat /tmp" errors with "is a directory" and
|>so is "echo hhh >! /tmp" (both as "root").
|>
|
|Well, I suppose that cat (1) and echo (1) check (!) to see if the file is a
|directory and if it is print an error message to stderr. However, since
I don't have time to check the sources of cat and echo (echo is tcsh's
built-in, btw), but the error text is the standard string of
perror(3). I suspect your Joe either doesn't check the success of the
open or could it be that you use a filesystem other than ext2fs?
|joe(1) from some reason does not do it when it reads the filename, it may
|also allow it for writing. (after all, the owner user and group of the
|directory cannot be changed with write(2), since they are not part of its
|contents.)
Did you actually try to write?
--Amos
--Amos Shapira | "Of course Australia was marked for
133 Shlomo Ben-Yosef st. | glory, for its people had been chosen
Jerusalem 93 805 | by the finest judges in England."
ISRAEL amos@gezernet.co.il | -- Anonymous
References: