creating a folder on a new drive?

P

Peter Sanders

Folks

I start off with a blank volume on win2000 (not mounted and not
formatted). I mount a drive letter onto this volume by delegating to
microsoft diskpart, then, format the volume (NTFS) by delegating to
dos format command. Both diskpart and format command then exit. I
now want to create an empty folder on the newly created drive.
Whichever way I try to do this (by java.io.File mkdirs, or by
delegating to dos mkdir command, or by C calls to windows operating
system), I get the same error message : "The parameter is incorrect".

Has anyone got any ideas why I can't create an empty folder on the
newly created drive, or any suggestions how to do it?

Thanks in advance

Peter Sanders
 
Y

Yu SONG

Peter Sanders said:
I start off with a blank volume on win2000 (not mounted and not
formatted). I mount a drive letter onto this volume by delegating to
microsoft diskpart, then, format the volume (NTFS) by delegating to
dos format command. Both diskpart and format command then exit. I
now want to create an empty folder on the newly created drive.
Whichever way I try to do this (by java.io.File mkdirs, or by
delegating to dos mkdir command, or by C calls to windows operating
system), I get the same error message : "The parameter is incorrect".

Has anyone got any ideas why I can't create an empty folder on the
newly created drive, or any suggestions how to do it?

Have you tried "md" by yourself? (To make sure you can create an empty
folder on that drive)

--
Song

/* E-mail.c */
#define User "Yu.Song"
#define At '@'
#define Warwick "warwick.ac.uk"
int main() {
printf("Yu Song's E-mail: %s%c%s", User, At, Warwick);
return 0;}

Further Info. : http://www.dcs.warwick.ac.uk/~esubbn/
_______________________________________________________
 
P

Peter Sanders

Hi Song,

Yes, we've tried that and it does work (ie it does create the folder).

If in one run of the code I simply mount and format the drive and then
in another separate run of the code I try to create the folder on the
new drive, this works, the folder is created.

However, if I try to do it all in one run of the code (i.e. mount,
format and create folder) the folder creation fails. It seems that
java isn't fully aware of the newly created drive...

Once the drive has been mounted and formatted, doing:
Arrays.asList(File.listRoots());
gives a list of all drives: C:, D: and Q: (new drive letter is Q).
but then the following conditions are met:
(new File("Q:").exists() == false)
and
(new File("Q:\").exists() == false)
i.e. the File.listRoots() function is aware of the new drive
but the File.exists() function is not aware of the new drive...
Then however I try to create the folder, folder creation fails.

Help...

Thanks in advance

Peter Sanders
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top