Author
how to creat a directory?
Maha Hassan
Ranch Hand
Joined: Aug 02, 2005
Posts: 133
posted Aug 18, 2005 09:51:00
0
Dear All i want to creat a directory and then add a file to it well i know how to creat a file File test = new File (file path); and i know to test wheather or not this is a directory BUT!! how to CREAT a directory in the first place please help me thanks
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35443
posted Aug 18, 2005 09:56:00
0
Check out the File.mkdir() and File.mkdirs() methods; they create one directory or a hierarchy of directories, respectively.
Android apps – ImageJ plugins – Java web charts
Maha Hassan
Ranch Hand
Joined: Aug 02, 2005
Posts: 133
posted Aug 18, 2005 10:14:00
0
both are boolean i want to set the file to a directory
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24081
Read the documentation: they create a directory, and return true or false to indicate success.
[Jess in Action] [AskingGoodQuestions]
Joanne Neal
Rancher
Joined: Aug 05, 2005
Posts: 3011
Originally posted by Maha Aburahma: well i know how to creat a file File test = new File (file path);
This does not create a file. It creates a File object that represents an operating system file, but that file will not be created by this call.
Joanne
subject: how to creat a directory?