Closed Bug 345397 Opened 18 years ago Closed 18 years ago

Support pathnames in nsLocalFileOSX::SetPersistentDescriptor

Categories

(Core Graveyard :: File Handling, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mark, Assigned: mark)

Details

(Keywords: fixed1.8.1)

Attachments

(1 file)

Right now, the nsILocalFile implementation on Mac OS X uses opaque alias records in base64 encoding for persistent descriptors.  This is the source of all of that non-editable garbage in the prefs for things like browser.download.defaultFolder, where other platforms use pathnames.

I'd like to extend SetPersistentDescriptor to accept pathnames on Mac OS X as well.  Because the base64 encoding used for alias records doesn't use the characters '/' or '~', I propose that any string passed to SetPersistentDescriptor beginning with either of those characters be treated as a pathname.

I'm not proposing that we modify GetPersistentDescriptor to return pathnames at this time: that method should continue to return base64-encoded alias records, so prefs set through an application's UI will continue to be set in an unreadable base64 form.  There are two reasons for this: to retain profile backwards compatibility, and to retain the functionality of alias records for the time being.  Alias records are what allow the system to follow moved and renamed files, and we should consider this carefully before discontinuing their use.  More background on alias records is available at http://developer.apple.com/documentation/Carbon/Reference/Alias_Manager/ .

A good reason to do this is a by-product of bug 311292 may be a hidden pref to specify a directory, and users will have a much easier time modifying this pref if they should choose to do so if they are able to set a native pathname.

I would like to get this change in for 1.8.1, because it will make it easier to change GetPersistentDescriptor to return pathnames the future, if we elect to.  If we make the proposed SetPersistentDescriptor change for 1.8.1, then Firefox 2 will not experience profile compatibility problems should Firefox 3 (or some higher number) begin putting pathnames into the prefs.

This bug report is long.  The actual implementation will be about 3 lines long.
Attached patch Patch v1Splinter Review
Like I said, three lines.
Attachment #230056 - Flags: review?(joshmoz)
Attachment #230056 - Flags: review?(joshmoz) → review+
Attachment #230056 - Flags: superreview?(darin)
Attachment #230056 - Flags: superreview?(darin) → superreview+
Comment on attachment 230056 [details] [diff] [review]
Patch v1

Rationale for 1.8.1 in comment 0.
Attachment #230056 - Flags: approval1.8.1?
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Comment on attachment 230056 [details] [diff] [review]
Patch v1

a=drivers. Please go ahead and land this on the branch.
Attachment #230056 - Flags: approval1.8.1? → approval1.8.1+
Checked in on MOZILLA_1_8_BRANCH before 1.8.1b2.
Keywords: fixed1.8.1
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: