This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about file configuration

 
kayanaat sidiqui
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am having this piece of code-



folderName is configured in xml as follows-
<property name="logBackupFolder">
<value>d:/my</value>
</property>


at line 3 i am getting- dir : d:/My/2009-03-10_04-09-28 (it's correct)
but at line 5- newDir : false , which must be true.

Can you people please help me to find out where is the problem.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does d:/my already exist ? If not, you'll probably be interested to look at another method called mkdirs().
 
kayanaat sidiqui
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Christophe Verré,

Thanks for solution. it's working fine.

I just want to know that wether this code will behave in same manner on unix also?
I mean using mkdirs(), if folder doesnot exist, it will create.

 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mkdirs() will create all parent folders as needed on all platforms, so yes, this will also work on Unix. Well, as long as you have the rights to create the folders of course, but that is also an issue on Windows.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic