Is a file an alias?

David Bovill david at openpartnership.net
Mon May 5 13:32:50 EDT 2008


How about:

function file_IsAlias someFile
    put the aliasreference of someFile into testAlias
    return someFile is not testAlias or testAlias is empty
end file_IsAlias

Any problems with that - how does it work on Linux?


2008/5/5 Martin Baxter <mb.userev at harbourhosting.co.uk>:

> David Bovill wrote:
> > I guess this works? Can someone test it on windows?
> >
> > function file_IsAlias someFile
> >>     put the aliasreference of someFile into testAlias
> >>     return someFile is not testAlias
> >> end file_IsAlias
> >>
> >
> > 2008/5/5 David Bovill <david at openpartnership.net>:
> >
> >> Is there a way to find out if a file is an alias. The only way I can do
> it
> >> at the moment is with MacOS specific hacks?
> >>
>
> If the file in question is *not* an alias (aka a shortcut on Windows)
> the aliasreference returns empty here on XP. So I would expect the above
> function to always report that someFile <> testAlias, Regardless of
> whether it was one or not.
>
> On Windows, shortcuts have the file extension ".lnk", perhaps all you
> need to do is check for that?
>
> A quick test shows this works on my system:
>
>  answer file "whatever"
>  put it into vv
>  if vv is not empty then
>    set itemdelimiter to "."
>    if last item of vv = "lnk" then
>      put "Is a shortcut"
>    else
>      put "is not a shortcut"
>    end if
>  end if
>
> Martin Baxter
>
> --
> I am Not a Number, I am a free NaN
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list