aspose file tools*
The moose likes Beginning Java and the fly likes file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "file" Watch "file" New topic
Author

file

Jackie Wang
Ranch Hand

Joined: Apr 18, 2002
Posts: 315
I would like to write and create a file in a directory, says /root/mytest/
the file name will be mytest.txt.
If mytest.txt is there. I would like to create the new files as mytest_1.txt, if it's also there, new files will be mytest_2.txt.
What should I do? Thanks!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61658
    
  67

What does the code you have written so far look like? What aspect of it is giving you problems?
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jackie Wang
Ranch Hand

Joined: Apr 18, 2002
Posts: 315
I am create some file after running some exe file.
I hope the first file name will be mytest.txt while if there is 1 more file generate, won't overwrite the old one.
thx
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

What does the code you have written so far look like?

Please post you code, using *code* tags, and we will be happy to try and help.


Please ignore post, I have no idea what I am talking about.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: file