CreateDirectory doesn't

VERIFIED DUPLICATE of bug 16414

Status

()

P3
normal
VERIFIED DUPLICATE of bug 16414
19 years ago
19 years ago

People

(Reporter: danm.moz, Assigned: racham)

Tracking

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

19 years ago
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.

Updated

19 years ago
Assignee: warren → dougt

Comment 1

19 years ago
-> dougt

Updated

19 years ago
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → WORKSFORME

Comment 2

19 years ago
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.
(Reporter)

Updated

19 years ago
Status: RESOLVED → REOPENED
(Reporter)

Comment 3

19 years ago
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??

Comment 4

19 years ago
sure.  who owns the pref code nowadays?

Updated

19 years ago
Resolution: WORKSFORME → ---
Target Milestone: M9

Comment 5

19 years ago
Clearing Fixed resolution due to reopen of bug.

Could we release note for M9?  Or too ugly :-)?
(Reporter)

Updated

19 years ago
Assignee: dougt → selmer
Status: REOPENED → NEW
(Reporter)

Comment 6

19 years ago
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.)
(Reporter)

Updated

19 years ago
Target Milestone: M9

Comment 7

19 years ago
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.

Updated

19 years ago
Assignee: selmer → racham

Comment 8

19 years ago
Gayatri was going to look at this, see if she did anything before you start.
(Reporter)

Comment 9

19 years ago
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)

Updated

19 years ago
Assignee: racham → gayatrib
(Assignee)

Comment 10

19 years ago
Reassigning to gayatri.

Updated

19 years ago
Status: NEW → ASSIGNED

Updated

19 years ago
Target Milestone: M12
(Reporter)

Comment 11

19 years ago
This morning's build (I haven't tried this in a while) seems fixed.
(Assignee)

Updated

19 years ago
Blocks: 14941
(Reporter)

Comment 12

19 years ago
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?

Updated

19 years ago
QA Contact: rickg → gbush

Comment 13

19 years ago
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)

Updated

19 years ago
Assignee: gayatrib → racham
Status: ASSIGNED → NEW
(Assignee)

Comment 14

19 years ago
reassigning to myself.
(Assignee)

Updated

19 years ago
Status: NEW → RESOLVED
Last Resolved: 19 years ago19 years ago
Resolution: --- → DUPLICATE
(Assignee)

Comment 15

19 years ago
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 ***

Updated

19 years ago
Status: RESOLVED → VERIFIED

Comment 16

19 years ago
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.