Re: Translating filenames for command line?
Re: Translating filenames for command line?
- Subject: Re: Translating filenames for command line?
- From: Scott Anguish <email@hidden>
- Date: Tue, 1 Jan 2002 08:51:37 -0500
which is all well and good, except that would require writing code that
gets compiled into the installer for each app.
In this case, the delete was handled in a pre/post install script. It
has no access to anything like that.
Geez folks, LOOK at the installer package.
On Tuesday, January 1, 2002, at 08:44 AM, Rosyna wrote:
that's debateable ;) some people suggest (correctly) that it never
would have happened if the installer looked for an application with
creator code hook, checked to see if it was not a classic app, and
removed that. (a few lines of code when using LaunchServices.
* Discussion:
* Returns the application with the corresponding input information.
* The registry of applications is consulted first in order of
* bundleID, then creator, then name. All comparisons are case
* insensitive and 'ties' are decided first by version, then by
* native vs. Classic.
FSRef ref;
OSStatus err=LSFindApplicationForInfo('hook',NULL,NULL,&ref,NULL);
if (!err)
{
LSItemInfoRecord infoRec;
LSCopyItemInfoForRef(&ref,kLSRequestAppTypeFlags,&infoRec);
if (infoRec.flags & kLSItemInfoIsNativeApp)
err=FSDeleteObject(&ref);
if (err)
//report error, don't delete contents of hard drives.
}
It just makes me wonder what happens right now if my hard drive name is
in quotes? Will it do rm -rf "/Volumes/"MyHD/Stuff" ( rm -rf
"/Volumes/" and rm -rf MyHD/Stuff")
Ack, at 1/1/02, Scott Anguish said:
It would have been the same problem if they'd called it via
NSTask (and that's more likely how that script was called...)
System() wasn't the culprit there... lack of testing was
--
Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug
Unsanity: Unsane Tools for Insane People