Ask a Question related to Mac Applications & Software, Design and Development.
-
Fred Moore #1
?Hard links, Soft links, & Aliases--Explain
Hi All,
Could some knowledgeable UNIX type please explain the differences between
hard links, soft links, and traditional Mac aliases. Responses which
include the important ramifications of the differences would be most
appreciated.
I'm pretty familiar with the ins and outs of Mac aliases; but the other
day I repaired a dual boot Mac using Norton booted into 9.2.2 and it
generated a file called Lost and Found containing a whole bunch of zero KB
items labeled 'Hardlink [some long numeric string]'.
Any info will be appreciated; tia.
--Fred
Fred Moore Guest
-
Displaying multiple values - Hard to explain here...
Hi All! Ok. I've got a query that's pulling data from multiple child tables based on the primary key from the parent table and displaying it in... -
How to find hard links
For symbolic links, we can issue "ls -l" command to see the file the link points to. Is there any command to see the file the hard link point to? ... -
Shortcuts/aliases/sym-links?
Dan Phiffer wrote: Well unix symlinks are made with ln -s /path/to/file, and a symlink to that file will be placed in the dir that command is... -
When we move Image Links and HTML links
On our Local Site (hard drive), our web projects is almost complete and we have already uploaded and sync the internet site (remote site). I have... -
Soft vs. hard returns
In FMPro 5.5, I need to create a calc field that concatonates several fields together with a hard (chr 13) return at the end of each field. So, I... -
Jeremy #2
Re: ?Hard links, Soft links, & Aliases--Explain
Fred Moore <fmoore@gcfn.org> wrote:
A "hard link" is a name for a file. When you make a hard link to a file,> Could some knowledgeable UNIX type please explain the differences between
> hard links, soft links, and traditional Mac aliases. Responses which
> include the important ramifications of the differences would be most
> appreciated.
you are adding a name for it in the filesystem, which is on equal standing
with the original name -- nether of the two is the "real" filename, they
both are now equally names for the same file.
Technically, every file has at least one hard link -- what you think of as
the filename. It points to the actual data on the disk. If you have more
than one, it's just more than one filesystem entry pointing to the same
data.
A soft link, or "symbolic link", points to another file by name. If you
change the name of the target file, the link becomes invalid, because the
reference it was using was the filename. However, completely changing
the underlying file (including what disk it's on) will not invalidate
the symlink as long as the path name stays the same.
A Mac alias points to another file's data, regardless of the name. Since
it's pointing at the disk data, it becomes invalid if you move the original
file to a different filesystem (a different disk, for example). It will
technically also become invalid if you replace the underlying file but keep
the name the same, but they've worked around that -- if the alias is invalid
but there is a new file in place of the old file, the alias will now refer
to the new file.
This can actually cause confusion; if you have an alias to a file, and you
move the original file to the trash and replace it with a new file (for
example, installing the new version of a program), but you don't empty
the trash, the alias still points to the *old* file, now in the trash,
even though there is a new file with the same name in its place (because
an alias points to the file, not the name). But if you empty the trash,
then use the alias, the Mac will see that its file is gone but a new one
is in its place, and start pointing to that instead.
Those would be files that lost their "link" to the filesystem. What you> I'm pretty familiar with the ins and outs of Mac aliases; but the other
> day I repaired a dual boot Mac using Norton booted into 9.2.2 and it
> generated a file called Lost and Found containing a whole bunch of zero KB
> items labeled 'Hardlink [some long numeric string]'.
have is the data, but none of the metadata, including the filename itself.
It recovered the files themselves but had no idea what files they were, so
they ended up in Lost and Found with random-looking names.
--
Jeremy | [email]jeremy@exit109.com[/email]
Jeremy Guest
-
Tom Stiller #3
Re: ?Hard links, Soft links, & Aliases--Explain
In article <bdcpd5$m2n$1@acme.gcfn.org>, [email]fmoore@gcfn.org[/email] (Fred Moore)
wrote:
From the man page for 'ln':> Hi All,
>
> Could some knowledgeable UNIX type please explain the differences between
> hard links, soft links, and traditional Mac aliases. Responses which
> include the important ramifications of the differences would be most
> appreciated.
A hard link to a file is indistinguishable from the original
directory entry; any changes to a file are effective independent
of the name used to reference the file. Hard links may not
normally refer to directories and may not span file systems.
A symbolic link contains the name of the file to which it is linked.
A Mac alias contains both the name of the file to which it points and
its volume reference number.
You can move a hard link to another subdirectory in the same filesystem
and will still reference the (one and only) file (inode) to which it
refers.
If you move the target of a soft link, you break the link.
You can move a Mac Alias to another subdirectory on the same volume and
it will still reference the (one and only) file (VolRefNo) to which it
refers.
--> I'm pretty familiar with the ins and outs of Mac aliases; but the other
> day I repaired a dual boot Mac using Norton booted into 9.2.2 and it
> generated a file called Lost and Found containing a whole bunch of zero KB
> items labeled 'Hardlink [some long numeric string]'.
>
> Any info will be appreciated; tia.
>
> --Fred
Tom Stiller
PGP fingerprint = 5108 DDB2 9761 EDE5 E7E3
7BDA 71ED 6496 99C0 C7CF
Tom Stiller Guest
-
Fred Moore #4
Re: ?Hard links, Soft links, & Aliases--Explain
Thanks, Jeremy and Tom! Just what I needed to know. Certainly didn't
understand about multiple hard links being equal. Now I do.
Fred Moore (fmoore@gcfn.org) wrote:
: I'm pretty familiar with the ins and outs of Mac aliases; but the other
: day I repaired a dual boot Mac using Norton booted into 9.2.2 and it
: generated a file called Lost and Found containing a whole bunch of zero KB
: items labeled 'Hardlink [some long numeric string]'.
To follow up on these Lost and Found hardlinks, should I delete them? Is
the file system accessing them w/o names? How did they lose their names?
And what might be in them?
Thanks again,
--Fred
Fred Moore Guest
-
Anno Siegel #5
Re: ?Hard links, Soft links, & Aliases--Explain
Fred Moore <fmoore@gcfn.org> wrote in comp.sys.mac.system:
The numeric part is usually the inode number of the file.> Thanks, Jeremy and Tom! Just what I needed to know. Certainly didn't
> understand about multiple hard links being equal. Now I do.
>
> Fred Moore (fmoore@gcfn.org) wrote:
> : I'm pretty familiar with the ins and outs of Mac aliases; but the other
> : day I repaired a dual boot Mac using Norton booted into 9.2.2 and it
> : generated a file called Lost and Found containing a whole bunch of zero KB
> : items labeled 'Hardlink [some long numeric string]'.
If you're sure *you* don't want them, delete them (but not the> To follow up on these Lost and Found hardlinks, should I delete them?
lost+found directory itself).
No.> Is the file system accessing them w/o names?
Some file system malfunction. Could be hardware or software.> How did they lose their names?
Anything. If a disk repair program (fschk, most notably) finds a file> And what might be in them?
with no directory entry pointing to it, it places the file into the
lost+found directory under a made-up name (the "Hardlink..." you saw).
It is up to you to inspect the content (if any) and do with it as you
please. If you happen to be able to identify a file in lost+found (a
rare occurrence) you may be able to put it back where it belongs and
save yourself some work.
If you can't identify them you may as well delete them. The files are
lost to the system anyhow, you won't make things worse than they already
are.
Anno
Anno Siegel Guest
-
Fred Moore #6
Re: ?Hard links, Soft links, & Aliases--Explain
Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote:
[lots of informative stuff about hardlinks and lost and found]
Thanks, Anno. Really helps me get a grip on this. I'll start inspecting
the files to see what's in them.
--Fred
Fred Moore Guest



Reply With Quote

