Re: Alias Files
Re: Alias Files
- Subject: Re: Alias Files
- From: Doug McNutt <email@hidden>
- Date: Wed, 12 Sep 2007 15:07:13 -0600
At 12:21 -0500 9/12/07, Luther Fuller wrote:
>I ran into a problem late yesterday. I'll spare you all the gory details and offer this problem instead ...
>
> A folder contains two files exactly, one of the files is an alias file
> pointing to the other file. Write a script that will remove ONLY
> the alias file from this folder.
>
>If the alias file was created by Mac OS X, then the problem is easy to solve. Ask the Finder for a list of the contents of the folder, then find and delete the item whose 'class of item ...' is 'alias file'.
>
>But, what if the alias file is a symlink? (The folders I'm actually dealing with are from an ISO 9660 CD)
>I'm thinking that it can't be done.
I'm not quite sure what "exactly" means here. You really can't have two files with the exact same name in a single folder.
But watch for suppressed extensions as practised by Finder. Even if you have Finder set to display extensions it NEVER displays a .app extension. That can make two files, an APPL and an alias to it appear to have the same name but deep down in the system, one of them really has a .app extension. If you "remove" it with a shell rm command you'll have to add the extension while you would have no extension on the symlink.
If the files show different names and "exactly" just means there are only two files the symlink will show itself with a ls -F command or, probably, with a Finder GetInfo command. In icon view OS 10.3.9 shows a little arrow on symlinks as well as on alias files. I donno about 10.4 and I'm not ready to drop my SE/30 file server so I can use it.
--
--> From the U S of A, the only socialist country that refuses to admit it. <--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
References: | |
| >Alias Files (From: Luther Fuller <email@hidden>) |