Closed Bug 122571 Opened 23 years ago Closed 23 years ago

Need API to detect a Mac OS 9/X package

Categories

(Core Graveyard :: File Handling, defect)

PowerPC
Mac System 9.x
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mozilla, Assigned: mozilla)

Details

Attachments

(1 file, 1 obsolete file)

Status: NEW → ASSIGNED
Attached patch IsPackage() method (obsolete) — Splinter Review
This patch adds a IsPackage() method onto nsILocalFileMac Conrad, care to review?
Comment on attachment 67068 [details] [diff] [review] IsPackage() method >+NS_IMETHODIMP >+nsLocalFile::IsPackage(PRBool *outIsPackage) >+{ >+ NS_ENSURE_ARG(outIsPackage); >+ *outIsPackage = PR_FALSE; >+ >+ PRBool isDir; >+ nsresult rv = IsDirectory(&isDir); // Calls ResolveAndStat() >+ if (NS_FAILED(rv)) return rv; Since IsDirectory() also calls UpdateCachedCatInfo(), I'd change the comment to say that and not make another call to UpdateCachedCatInfo(TRUE). Unless you really want to pass TRUE and force an update of the cached info. >+ >+ rv = UpdateCachedCatInfo(PR_TRUE); >+ if (NS_FAILED(rv)) return rv; >+ >+ const char *extPtr = strrchr(name, '.'); >+ if (extPtr) >+ { >+ if (!nsCRT::strcasecmp(extPtr, ".app")) There's also .framework and .bundle. Do we want to consider those as well? Probably. >+ { >+ *outIsPackage = PR_TRUE; >+ } >+ } >+ } >+ } >+ >+ return NS_OK; >+} >+ Other than those points, which are debatable, looks good.
How do you intend to support BSD utils like bzip2/gzip in X ?
Keywords: qawanted
QA Contact: sairuh → nobody
> Since IsDirectory() also calls UpdateCachedCatInfo(), I'd change the comment > to say that and not make another call to UpdateCachedCatInfo(TRUE). OK. > There's also .framework and .bundle. Do we want to consider those as well? I think the answer is "no", after observing how the Finder treats folders with those extensions (it doesn't consider them to be a single item).
Patch incorporating Conrad's feedback [just use IsDirectory()]
Attachment #67068 - Attachment is obsolete: true
Comment on attachment 67125 [details] [diff] [review] Patch which just uses IsDirectory() Yeah, if the Finder only treats .app differently and treats .bundle as a directory, that's the way to go. r=ccarlen.
Attachment #67125 - Flags: review+
Comment on attachment 67125 [details] [diff] [review] Patch which just uses IsDirectory() sr=ben@netscape.com
Attachment #67125 - Flags: superreview+
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Verified..
Status: RESOLVED → VERIFIED
Keywords: qawanted
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: