Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

directories and sub directories.  RSS feed

 
Anas El-Abboud
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello friends , i faced aproblem :

i want to scan all directories of "homeDir" to copy a trial file into them but i can't copy the file except the first level of the dir..
that means if i searched a multi level tree of directory i can't access all its levels !
what can i do ?



thanks
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to include the path in the file name. It can be relative to your working directory or absolute. Take a look at the Java API Documentation for java.io.File.
 
Anas El-Abboud
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Joe Ess , i tried to put the getProperty("user.dir");
and it worked ! , thanks friend..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!