[jcifs] How to create a directory ?

LE SQUER Rodolphe RLESQUER at aston.fr
Tue Jul 8 18:13:09 EST 2003


 I've got it. I used the File.separator to get the system specific separator
( it is of course a '\' under Windows :-) ). It seems to work to create a
file, but not for a directory (got an invalid directory error). I replace
File.separator with a '/' and it is ok. 

 Thanks for your answer and your great work on jcifs.


-----Message d'origine-----
De: Allen, Michael B (RSCH)
A: LE SQUER Rodolphe; 'jcifs at lists.samba.org'
Date: 08/07/03 00:38
Objet: RE: [jcifs] How to create a directory ?

(new SmbFile("smb://server/share/")).mkdir()  // not possible
(new SmbFile("smb://server/")).mkdir()  // not possible
(new SmbFile("smb://workgroup/")).mkdir()  // not possible
(new SmbFile("smb://server/share/directory/")).mkdir()  // ok if you
have permission

What's the error?

> -----Original Message-----
> From:	LE SQUER Rodolphe [SMTP:RLESQUER at aston.fr]
> Sent:	Monday, July 07, 2003 1:05 PM
> To:	'jcifs at lists.samba.org'
> Subject:	[jcifs] How to create a directory ?
> 
> Hello,
> 
>  I am not able to create a directory with the mkdir() or mkdirs()
method of
> the SmbFile class. The javadoc says that you cannot create a directory
when
> used with smb://, smb://workgroup, smb://server, or smb://server/share
URLs.
> My question may be stupid (sorry), but how can I create a SMB URL
without a
> workgroup, server or share in it ?
> 



More information about the jcifs mailing list