Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

File Object

  Asked By: Brooklyn    Date: Jul 07    Category: Java    Views: 556
  

I want to get use of the File object to do the
following process,
I have a directory in “d:/” named “an” which
has 3 files that I don’t know their names, I want to
read the content of these 3 files and do the
processing, then I should create another files that
the result would be in just created files.
For example imagine this: d:/an/m.txt (I don’t know
the name of the file is m.txt)
Then I should create a directory named “an” in
“d;\” and create another file named
m1.txt and save the result of processing in it.
After all, I should have d:/an1/m1.txt
How should do this?
Would you please provide me with its code?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Muntasir Bashara     Answered On: Jul 07

I'm not gonna give you code, but check out java.io.File and especially
listFiles() and the other variations of the same method with FileFilters.
If you don't even know what dirs are on the system you're looking at use
listRoots() .

 
Didn't find what you were looking for? Find more on File Object Or get search suggestion and latest updates.




Tagged: