Closed Bug 12107 Opened 25 years ago Closed 25 years ago

CreateDirectory doesn't

Categories

(Core :: XPCOM, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED DUPLICATE of bug 16414

People

(Reporter: danm.moz, Assigned: racham)

References

Details

Attempts to create a new directory don't work on Windows unless the parent directory already exists. You'll notice this if you're missing your profile directory and its parent. Say your profile name is gorgonzola. During Mozilla startup, it'll try to create the directory mozilla/dist/Users50/gorgonzola. And it will silently fail unless directories up through Users50 already exist. It comes to a call to xpcom/io/nsFileSpecWin.cpp/nsFileSpec::CreateDirectory(), which calls a library function mkdir(). The Windows version of that library function just doesn't do what we're expecting it to do.
Assignee: warren → dougt
-> dougt
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → WORKSFORME
CreateDirectory is not recursive. It only works on the current leaf. Use this instead: nsFileSpec(something, PR_TRUE); ^^^^^^^ This will create the directories to the final node. Then you can call CreateDirectory on the final node to create that. Take a look at the test application (mozilla/xpcom/tests/FilesTest.cpp) for examples of this.
Status: RESOLVED → REOPENED
Okayyyyy Maybe the problem is in the use of CreateDirectory and this bug needs to be reassigned to the caller of that function. Regardless of the problem, the symptom remains demonstrable: unless you pre-create Users50 by hand, the profile directory within Users50 is never created. Or is this only true on my machine??
sure. who owns the pref code nowadays?
Resolution: WORKSFORME → ---
Target Milestone: M9
Clearing Fixed resolution due to reopen of bug. Could we release note for M9? Or too ugly :-)?
Assignee: dougt → selmer
Status: REOPENED → NEW
Woo hoo! I say selmer gets it, because his bug 12186 sure sounds related. I don't know if we need to put this in the release notes: this problem has been true for months; I just got around to reporting it recently. (I figured somebody else *must* have noticed.)
Target Milestone: M9
Hmmm. I don't see this problem on yesterday's commercial build. It creates the users50 directory just fine on my NT box. Is this a win95/win98-ism? BTW, there is no relation to the bug http://bugzilla.mozilla.org/show_bug.cgi?id=12186 - that was caused by the gfx text widget checkin.
Assignee: selmer → racham
Gayatri was going to look at this, see if she did anything before you start.
It has never made the Users50 directory on either of my NT boxes, as long as I've been running Mozilla. This is why it throws a dozen asserts on startup with today's build.
Assignee: racham → gayatrib
Reassigning to gayatri.
Status: NEW → ASSIGNED
Target Milestone: M12
This morning's build (I haven't tried this in a while) seems fixed.
Blocks: 14941
And every Windows build I've made, every day this week, crashes on startup until I remember to go make the Users50 directory before I launch. Crimminy. Is no one else seeing this?
QA Contact: rickg → gbush
If I delete my users50 directory, but don't delete mozregistry.dat (which contains profile location info) then I get a message that says: Failed to start communicator with the paulmac profile. I can then create a new profile and launch successfully. This is on a commercial build from this morning.
Assignee: gayatrib → racham
Status: ASSIGNED → NEW
reassigning to myself.
Status: NEW → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → DUPLICATE
Fixed. There is no need to create User50 manually anymore. I checked in a fix to the bug 16414, which will do the recursive creation of parent folders too. Resolving this bug by marking it as a dup of Bug #16414. *** This bug has been marked as a duplicate of 16414 ***
Status: RESOLVED → VERIFIED
Bulk moving to XPCOM, in preparation for removal of XP File Handling component. (XPFH has received two bugs in ~5 months, and is no longer in active use.)
Component: XP File Handling → XPCOM
You need to log in before you can comment on or make changes to this bug.