> -----Original Message-----
> From: A mailing list about Java Server Pages specification
> and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of ranjith
> Sent: 07 December 1999 11:01
> To: [EMAIL PROTECTED]
> Subject: calling exec() from a servlet
>
>
> hi everyone,
>         Is it possible to use runtime.exec() to create a directory in
> the server , based on the input from a user for e.g if a user by the
> name "ami"t registers for a service then i would like my
> servlet or jsp
> to create a directory by the name "amit",will this be
> possible,if so how
> to be done and are there any security restrictions.
>     ranjith

Surely it would be preferable to use the java.io.File class?

eg
   File file = new File( "/home/www/users/amit" );

   // Make directory
   file.mkdir();
   // or
   // Make directory and any intermediate directories
   file.mkdirs();

You may also check whether a file exists already and whether the file is a
file or directory with other methods in the File class.

The only security restrictions will be those imposed by the server you are
running on which may depend on the 'user' the servlet engine is effectively
running as.

HTH,

Steve

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to