Closed Bug 93688 Opened 24 years ago Closed 23 years ago

saving mozilla.ps in install directory is bad

Categories

(Core :: Printing: Output, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED FIXED
mozilla1.0

People

(Reporter: darin.moz, Assigned: bzbarsky)

References

Details

(Keywords: helpwanted)

Attachments

(1 file, 1 obsolete file)

when printing to a file, the default value for the file is mozilla.ps; however, when i choose to print to this file, this file doesn't appear to be created... at least it doesn't appear in my home directory where i would expect it to be found. where does mozilla.ps live? i've searched my harddrive in vain!
this is a major problem for first time mozilla/linux users.
Severity: normal → major
Can you comment on this, I know the file is created in a default directory, but I am not good at linux so I am not sure where. My print to file works everytime and I remember someone having this difficulty and it turned out to not be a bug it was more a problem of where the default directory was. Thanks Syd.
Assignee: dcone → syd
darin, please see bug 86598. mozilla.ps should be created in the directory where you started mozilla/netscape. I'm gonna mark this a DUP of that bug...just waiting to hear back from Darin.
Darin, look in the directory where you installed netscape/mozilla. thats where the mozilla.ps file should be..and this is by design. REOPEN if you still don't see the mozilla.ps file created in that dir. *** This bug has been marked as a duplicate of 86598 ***
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
v
Status: RESOLVED → VERIFIED
it can not be created in the directory containing the mozilla binary because i don't have write access to that directory. so, if that is the intended behavior then there is a definitely a bug here.
i'm reopening this bug... having the file saved to the directory in which mozilla was launched is IMO the wrong this to do. it is extremely inconsistent with other applications, and will likely confuse each and every user (at least) the first time they try to print to a file. as an exercise, click "Choose a File" and notice that the default directory is the users home directory -- NOT the directory from which mozilla was started!
Status: VERIFIED → REOPENED
Resolution: DUPLICATE → ---
changing summary and cc: dcone
Summary: default value for "print to file" file doesn't work!?! → saving mozilla.ps in install directory is bad
*** Bug 111604 has been marked as a duplicate of this bug. ***
Attached patch proposed patch (obsolete) — Splinter Review
reviews?
Assignee: syd → bzbarsky
Status: REOPENED → NEW
Keywords: patch, review
Priority: -- → P3
Target Milestone: --- → mozilla0.9.7
*** Bug 111604 has been marked as a duplicate of this bug. ***
Comment on attachment 59055 [details] [diff] [review] proposed patch >+ if (aToFileName && aToFileName[0] != '/') { Is this a Unix-only feature? Windows machines (NT and later) can have just as much problem writing into the install directory. >+ nsCOMPtr<nsIFile> homeDir; >+ NS_GetSpecialDirectory(NS_OS_HOME_DIR, getter_AddRefs(homeDir)); >+ nsXPIDLString homepath; >+ homeDir->GetUnicodePath(getter_Copies(homepath)); >+ mToFileName = homepath + NS_LITERAL_STRING("/") + nsDependentString(aToFileName); >+ } else { >+ mToFileName = aToFileName; >+ } Slinging raw filenames around the system is fraught with peril. This whole mechanism might be better off re-written using nsIFile, and instead of just checking for relative vs absolute paths why not check the target directory for writability? Sorry if these comments are off base, I've not looked at any surrounding code, just what's in the patch.
Comment on attachment 59055 [details] [diff] [review] proposed patch This is a "unix-only" feature -- it's used on BeOS, OS/2, and with GTK/QT/Xlib. BeOS can do the filenames this way (it had better, it hardcodes things like |sprintf(foo, "%s/mozilla.ps", PR_GetEnv("HOME"));| But you're right, this should use nsIFile or at least move this logic into the system-specific device contexts (yay code duplication). There's no way to get the home directory from JS, so moving into the device context it is.
Attachment #59055 - Attachment is obsolete: true
Will try to get to this by early January...
Keywords: patch, review
Target Milestone: mozilla0.9.7 → mozilla0.9.8
not happening tonight
Target Milestone: mozilla0.9.8 → mozilla0.9.9
I'm going to try to get to this sometime before 1.0, but thesis is eating up most of my time... if someone can do this, please do.
Keywords: helpwanted
Target Milestone: mozilla0.9.9 → mozilla1.0
Well, rod's printsettings changes have helped.... Now the default is /home/bzbarsky/mozilla.ps for me (assuming I start mozilla from my home directory). Tempted to mark this fixed as a result. :)
sounds like a big improvement to me... would be nice though if the dialog showed the full path as it would if you used the filepicker.
Attached image screenshot of dialog
I should have been more clear. It _does_ show the full path.
then problem solved right? i'm content anyways ;-)
Good. Just wanted to make sure you agreed. :)
Status: NEW → RESOLVED
Closed: 24 years ago23 years ago
Resolution: --- → FIXED
Just to verify here: if the user starts mozilla via an icon on his desktop, will his home directory still be chosen in this dialog? Because that's how most people start mozilla in the real world.
I just tried it myself, and it works perfectly even if I create a link to /usr/local/mozilla/mozilla. Good job boys.
marking verified per latest comments.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: