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)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: mozilla, Assigned: mozilla)
Details
Attachments
(1 file, 1 obsolete file)
|
2.10 KB,
patch
|
ccarlen
:
review+
bugs
:
superreview+
|
Details | Diff | Splinter Review |
| Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 1•23 years ago
|
||
| Assignee | ||
Comment 2•23 years ago
|
||
This patch adds a IsPackage() method onto nsILocalFileMac
Conrad, care to review?
Comment 3•23 years ago
|
||
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.
Comment 4•23 years ago
|
||
How do you intend to support BSD utils like bzip2/gzip in X ?
| Assignee | ||
Comment 5•23 years ago
|
||
> 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).
| Assignee | ||
Comment 6•23 years ago
|
||
Patch incorporating Conrad's feedback [just use IsDirectory()]
Attachment #67068 -
Attachment is obsolete: true
Comment 7•23 years ago
|
||
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 8•23 years ago
|
||
Comment on attachment 67125 [details] [diff] [review]
Patch which just uses IsDirectory()
sr=ben@netscape.com
Attachment #67125 -
Flags: superreview+
| Assignee | ||
Comment 9•23 years ago
|
||
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Updated•9 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•