Open Containing Folder doesn't work if the file doesn't exist

NEW
Unassigned

Status

()

11 years ago
5 years ago

People

(Reporter: stevee, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

11 years ago
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b3pre) Gecko/2008010904 Minefield/3.0b3pre ID:2008010904

1. New profile, start firefox
2. Visit http://www.mozilla.org/projects/minefield/
3. Right click on the minefield logo, and choose Save As
4. Save the image somewhere.
5. Find the file on your HD and rename the image to something else
6. Tools > Downloads
7. Right click on the item for the logo you just saved, and choose Open Containing Folder

Expected:
- You should be taken to the directory where you saved the image; even tho you renamed the image, the directory still exists, and so should be opened.

Actual:
- Dialog thrown "The path C:\minefield-icon.png does not exist or is not a directory."
Just a datapoint; Mac's "Show in Finder" still works if you delete the selected file from under it.
Hrm, we already have code that would have handled this, I thought.
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/toolkit/mozapps/downloads/content/downloads.js&rev=1.130#252

It seems like this is only a problem on WinXP. The following succeeds (i.e. doesn't throw) on XP, but results in a "Path does not exist or is not a directory" alert dialog.

var nsLocalFile = Components.Constructor("@mozilla.org/file/local;1", "nsILocalFile", "initWithPath");
var f = new nsLocalFile("C:\\windows\\nosndofsdifjo.txt");
f.reveal();

On Vista, this code snippet results in a window opened at C:\Users\Gavin (the CWD presumably) with the "Documents" folder selected.
I suppose we could check Exists() ourselves and skip directly to launch()ing the parent, but I think reveal() really should throw in this case... according to MSDN ShellExecute should fail if the path passed in points to a non-existent file, and our impl of ::Reveal looks like it would catch that. More investigation needed, I guess.
(Assignee)

Updated

10 years ago
Product: Firefox → Toolkit

Comment 4

5 years ago
Still present in FireFox 26, and all previous releases.
You need to log in before you can comment on or make changes to this bug.