Professional Web Applications Themes

?Hard links, Soft links, & Aliases--Explain - Mac Applications & Software

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...

  1. #1

    Default ?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

  2. #2

    Default Re: ?Hard links, Soft links, & Aliases--Explain

    Fred Moore <fmooregcfn.org> wrote:
    > 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" is a name for a file. When you make a hard link to a file,
    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.
    > 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]'.
    Those would be files that lost their "link" to the filesystem. What you
    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]jeremyexit109.com[/email]
    Jeremy Guest

  3. #3

    Default Re: ?Hard links, Soft links, & Aliases--Explain

    In article <bdcpd5$m2n$1acme.gcfn.org>, [email]fmooregcfn.org[/email] (Fred Moore)
    wrote:
    > 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.
    From the man page for 'ln':
    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

  4. #4

    Default 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 (fmooregcfn.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

  5. #5

    Default Re: ?Hard links, Soft links, & Aliases--Explain

    Fred Moore <fmooregcfn.org> wrote in comp.sys.mac.system:
    > 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 (fmooregcfn.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]'.
    The numeric part is usually the inode number of the file.
    > To follow up on these Lost and Found hardlinks, should I delete them?
    If you're sure *you* don't want them, delete them (but not the
    lost+found directory itself).
    > Is the file system accessing them w/o names?
    No.
    > How did they lose their names?
    Some file system malfunction. Could be hardware or software.
    > And what might be in them?
    Anything. If a disk repair program (fschk, most notably) finds a file
    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

  6. #6

    Default Re: ?Hard links, Soft links, & Aliases--Explain

    Anno Siegel (anno4000lublin.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

Similar Threads

  1. Resetting "Visited" links to "links" color when new browser opens
    By cubeman in forum Macromedia Dynamic HTML
    Replies: 2
    Last Post: January 11th, 03:52 PM
  2. How to find hard links
    By olyathe in forum Linux / Unix Administration
    Replies: 3
    Last Post: October 17th, 05:45 PM
  3. Shortcuts/aliases/sym-links?
    By X-Istence in forum PHP Development
    Replies: 0
    Last Post: August 23rd, 05:58 PM
  4. When we move Image Links and HTML links
    By Gil in forum HTML & CSS
    Replies: 0
    Last Post: July 29th, 03:12 PM
  5. Soft vs. hard returns
    By Brett Bixler in forum FileMaker
    Replies: 2
    Last Post: July 23rd, 11:08 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139