This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes directory creation thru java program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "directory creation thru java program" Watch "directory creation thru java program" New topic
Author

directory creation thru java program

kan ashok
Greenhorn

Joined: Feb 28, 2004
Posts: 8
I want to create the directory thru my java program and whatever the log file i get i will store it in the created directory in the format of .txt file (text file name added with the timestamp also).
How can i do that ?
Max Habibi
town drunk
( and author)
Sheriff

Joined: Jun 27, 2002
Posts: 4118

HTH,
M


Java Regular Expressions
kan ashok
Greenhorn

Joined: Feb 28, 2004
Posts: 8
Hi Max, why are you using import java.nio.channels.* ?
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
It is safer to call the "mkdirs()" method when creating a directory, since this will work even if there are multiple directory levels that need to be created.
Once the full path exists, then you can easily save file there.
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
For more information, you should look at the Java API specification. In particular, you can look at the documentation for the File Class. I strongly encourage you to familiarize yourself with the Java API documentation. It is a great resource to help you find the answers to questions like this.
HTH
Layne


Java API Documentation
The Java Tutorial
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: directory creation thru java program
 
Similar Threads
add timestamp with .txt file & write some information to the .txt file
Nullpointer when reading a directory
No ClassDefFoundError
Browsing Directory Structure and opening a file in the subdirectory
jasper Reports