Re: file as a directory

From: Jan Engelhardt
Date: Tue Dec 14 2004 - 13:24:22 EST


>I don't imagine anyone would miss that behaviour, we can probably have
>something more useful than a
>cat: /etc: Is a directory
>message.

But if /etc can also be a file, cat would not complain!

>ok, I don't really care about the trailing slash. The reading method
>(read() vs. readdir()) may be enough to distinguish the uses. The
>trailing / is still a useful (and logical) visual notation though for
>the different meanings, so something like ls could give both versions.

Yes, indeed the idea itself is good. `ls` uses it to follow symlinks that
point to directories:

ls -l /U
lrwxrwxrwx 1 root root 35 Dec 6 22:03 /U ->
/media/usb-0000000000004287:0:0:0p

ls -l /U/
drwxr-xr-x 2 root root 48 Dec 6 14:27 .
drwxr-xr-x 31 root root 824 Dec 14 17:51 ..
-rw-r--r-- 1 root root 1614 Dec 12 23:57 tstpasswd

>> What will ls do?
>list both /etc/passwd and /etc/passwd/ perhaps?

Well, and before ls is tweaked to do so?



Jan Engelhardt
--
ENOSPC
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/