Re: ls -L [some symbolic linked file] not working
Re: ls -L [some symbolic linked file] not working
- Subject: Re: ls -L [some symbolic linked file] not working
- From: "Justin C. Walker" <email@hidden>
- Date: Tue, 19 Sep 2006 20:18:20 -0700
On Sep 19, 2006, at 20:01 , Steve Checkoway wrote:
On Sep 19, 2006, at 7:24 PM, Justin C. Walker wrote:
On Sep 19, 2006, at 19:12 , Steve Checkoway wrote:
I think the issue is that this behavior seems to contradict what
the man page says:
-L If argument is a symbolic link, list the file or
directory the
link references rather than the link itself. This
option cancels
the -P option.
I think if you read that correctly (i.e., the way I do :-}), it
says that instead of seeing the *file information* for the
symlink, as in
I read it as saying that if the argument is a symlink (as is foop
below), then it will list the file or directory the link references
(goop in this case), rather than the link itself. I'm not sure how
else to read that.
As I did. The key is in what "list the file" means, and I take it to
mean the information about the file, not the file name.
$ ls -l foop
lrwxr-xr-x 1 justin wheel 9 Sep 19 18:59 foop -> /tmp/goop
you see the *file information* for the linked-to file, as in
$ ls -lL foop
-rw-r--r-- 1 justin wheel 7 Sep 19 18:59 foop
In this case, it's showing the metadata of goop as being the
metadata of foop and not even showing that foop is a symlink. This
seems even worse.
This really is the correct behavior, and it is the way links work.
The file information in Unix file systems is divorced from the
file name.
Well, I'm not using UFS here, but I know what you're saying. I'm
really not sure how you managed to read the man page in that way.
Keep in mind, I quote the BSD man page, not the GNU man page (of
which I seem to have two different versions) which does mention
file information.
These are Unix command line tools, and whether it is UFS, HFS, or
another brand of file system, if links are supported, this is how
they behave:
- the directory entry for a file (of whatever type) consists of
the name
and a hook of some kind to get at the metadata, to use your word.
- that information (metadata) is separate from the file name
- links provide you the ability to have many names for the same
file
- the difference between a symbolic and a hard link is mostly in
implementation (the former gets you cross-device linking, and can
"break"; the latter is confined to one device and won't break).
The idea is that you can refer to the collection of bytes that works
out to "hello world\n" by the name 'foop' and I can refer to it as
'goop', and we really don't know that those two different names are
the same file (unless we do some detective work (using 'ls')).
If you type "ls -lL foop", you get the information about the file;
the name remains the same because that is how you refer to it.
Hope that is clearer.
Justin
--
Justin C. Walker, Curmudgeon-At-Large
Director
Institute for the Enhancement of the Director's Income
--------
"Weaseling out of things is what separates us from the animals.
Well, except the weasel."
- Homer J Simpson
--------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden