Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.io

 
sandeep Talari
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anybody help me regarding ,File class

this is the dought
how to make the directorys ,ok there were methods in File class named
boolean mkdir(),and boolean mkdirs().In Api its written under this method description is "Creates the directory named by this abstract pathname" what does it mean....


and there were methods like String[] list(), String[] listFiles(filefilter filter) under the description of these methods its written in Api that,"Returns an array of abstract pathnames denoting the files in the directory denoted by this abstract pathname" and " Returns an array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter" respectively please can anybody explain with small code piece and explain me the double coted sentences
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's how to use the mkdir() in java:



As for the listFiles():




Google is a wonderful tool

Justin Fox
 
Kaydell Leavitt
Ranch Hand
Posts: 690
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that Justin's answers are right, but I'd like to add that the difference between the methods:

mkDir();

and

mkDirs();

is that the method: mkDir() will only one directory

whereas the method mkDirs() will make as many directories as needed to make the full-path valid.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic