Relative aliases

  • We are trying to create aliases using the Alias Manager with a
    relative path. The idea is to store links to document-relative
    external files,. This should work on two different machines with the
    same (relative) setup (say a computer at home and on your work), or
    when the document is moved together with the linked external files.

    Until now all attempts have failed: the relative paths seem to be
    completely ignored, and only the absolute path and fileID seem to be
    used.

    For example if I create an alias with FSRefs to a file with as base
    location (fromFile argument) the file's folder, I copy the file to
    another location, and try to resolve the alias (or a copy of it) with
    as base location the folder of the copy, it does not find the copy,
    even though obviously the relative path should point to the copy. I'm
    creating the alias using FSNewAlias with both a fromFile and a
    target, and I'm resolving the alias using either FSResolveAlias, or
    FSMatchAlias with kARMSearch | kARMSearchRelFirst in the rulesMask.

    Does this problem sound familiar t anybody on the list? And is there
    something I could have done wrong? Or are aliases simply unable to
    work with relative paths (unlike what the documentation says)?

    Thanks,
    Christiaan
  • Am 26.10.2007 um 17:28 schrieb Christiaan Hofman:

    > We are trying to create aliases using the Alias Manager with a
    > relative path.

    What stops you from using symbolic links? I know, Apple drops more
    and more Unix goodies, but links appear to have a longer lifetime,
    Time Machine just offered a new version of them.

    Markus

    - - - - - - - - - - - - - - - - - - -
    Dipl. Ing. Markus Hitter
    http://www.jump-ing.de/
  • On Friday, October 26, 2007, at 11:16AM, "Markus Hitter" <mah...> wrote:
    >
    > Am 26.10.2007 um 17:28 schrieb Christiaan Hofman:
    >
    >> We are trying to create aliases using the Alias Manager with a
    >> relative path.
    >
    > What stops you from using symbolic links? I know, Apple drops more
    > and more Unix goodies, but links appear to have a longer lifetime,
    > Time Machine just offered a new version of them.

    The point of this is to be able to serialize a list of files to disk on one system, relative to e.g. the document location, then be able to locate them on another system with a potentially different directory structure (but the same location relative to the document).  Symlinks aren't going to help with that.

    --
    adam
  • On 10/26/07, Adam R. Maxwell <amaxwell...> wrote:
    >
    > On Friday, October 26, 2007, at 11:16AM, "Markus Hitter" <mah...> wrote:
    >>
    >> Am 26.10.2007 um 17:28 schrieb Christiaan Hofman:
    >>
    >>> We are trying to create aliases using the Alias Manager with a
    >>> relative path.
    >>
    >> What stops you from using symbolic links? I know, Apple drops more
    >> and more Unix goodies, but links appear to have a longer lifetime,
    >> Time Machine just offered a new version of them.
    >
    > The point of this is to be able to serialize a list of files to disk on one system, relative
    > to e.g. the document location, then be able to locate them on another system with a
    > potentially different directory structure (but the same location relative to the
    > document).  Symlinks aren't going to help with that.

    Why wouldn't symlinks work for this?

    --
    Clark S. Cox III
    <clarkcox3...>
  • On 26 Oct 2007, at 8:36 PM, Clark Cox wrote:

    > On 10/26/07, Adam R. Maxwell <amaxwell...> wrote:
    >>
    >> On Friday, October 26, 2007, at 11:16AM, "Markus Hitter" <mah...>-
    >> ing.de> wrote:
    >>>
    >>> Am 26.10.2007 um 17:28 schrieb Christiaan Hofman:
    >>>
    >>>> We are trying to create aliases using the Alias Manager with a
    >>>> relative path.
    >>>
    >>> What stops you from using symbolic links? I know, Apple drops more
    >>> and more Unix goodies, but links appear to have a longer lifetime,
    >>> Time Machine just offered a new version of them.
    >>
    >> The point of this is to be able to serialize a list of files to
    >> disk on one system, relative
    >> to e.g. the document location, then be able to locate them on
    >> another system with a
    >> potentially different directory structure (but the same location
    >> relative to the
    >> document).  Symlinks aren't going to help with that.
    >
    > Why wouldn't symlinks work for this?
    >
    > --
    > Clark S. Cox III
    > <clarkcox3...>

    Are you talking about symlinks, or (relative) paths? The former is a
    special type of file on the file system and has nothing to do with
    data to save. Moreover, symlinks are not versatile enough. Aliases do
    much more than symlinks, they should be able to find file by relative
    or absolute path or by file ID. We want to have all of this
    functionality to be as robust as possible, not just what a relative
    path has to offer. And anyway, I'm not talking about how I could find
    a workaround for this problem (I could figure that out if I need to).
    I am asking what the problem *is* and whether it is a real bug.
    Because the documentation on Alias Manager tell me that I should be
    able to do this with aliases alone.

    Christiaan
  • Am 26.10.2007 um 20:47 schrieb Christiaan Hofman:

    > Aliases do much more than symlinks, they should be able to find
    > file by relative or absolute path or by file ID. We want to have
    > all of this [...]

    You can't ask for an entry working in different locations and on
    different files while hoping the entry would consider absolute paths
    or file IDs.

    Possibly, I understood your request wrongly.

    Markus

    - - - - - - - - - - - - - - - - - - -
    Dipl. Ing. Markus Hitter
    http://www.jump-ing.de/
  • On 26 Oct 2007, at 9:24 PM, Markus Hitter wrote:

    >
    > Am 26.10.2007 um 20:47 schrieb Christiaan Hofman:
    >
    >> Aliases do much more than symlinks, they should be able to find
    >> file by relative or absolute path or by file ID. We want to have
    >> all of this [...]
    >
    > You can't ask for an entry working in different locations and on
    > different files while hoping the entry would consider absolute
    > paths or file IDs.
    >

    You can, if you can, why not? It's what the docs say: resolving an
    alias *tries* to find a file, first by relative path, then by
    absolute path, then by fileID. If you are *not* on the same location
    the latter 2 may fail, but it doesn't mean it can't try. On another
    location, they may simply fail. My point is that I fail to make the
    relative path search work, and *that* should certainly be possible
    across locations, right?

    Christiaan

    >
    > Possibly, I understood your request wrongly.
    >
    >
    > Markus
    >
    > - - - - - - - - - - - - - - - - - - -
    > Dipl. Ing. Markus Hitter
    > http://www.jump-ing.de/
    >
    >
    >
    >
previous month october 2007 next month
MTWTFSS
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        
Go to today