[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "losing" a file in the ext2 file-system
In message <Pine.SUN.3.96-heb-2.07.970715181605.8676B-100000@actcom.co.il> you
write:
|The real reason is that there is an opendir(2) function meant for
|directories, you don't just open(2) it. Check the manpage. It's a mystery
opendir(2) is a relatively late invention which followed the
introduction of multiple filesystem types and NFS, until then
directories were read using simple open(2)/read(2) (and user-level
libc routines to make this easier, routines which later were used to
cover system calls).
|to me why joe lets you open a dir (my copy won't do that). If you manage
|to edit a directory (or what joe thinks is a directory) you will have some
|very interesting sessions with inode numbers and inode tables and such
|until you sort out the mess. Even e2fsck won't help you because it can
|only fix the structure (inode tables etc) not the names. If you manage to
I suppose e2fsck would find a file with the link count higher than the
number of names mentioning this inode, if the file looks normal
otherwise (e.g. doesn't share data blocks with other files), and no
name points to it, then it will have a new name created for it under
the filesystem's lost+found (that's exactly what this directory is
for, it also has to have enough space allocated in it in order to let
e2fsck to add names without having to allocate new blocks in the
middle of the check).
--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
Follow-Ups:
References: