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

Copy  RSS feed

 
cameron weirs
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! All,
can somebody tell how to copy files in one directory to other directory in a java application . using Runtime and exec is not working on all platforms.
any idea in this regard will be highly appreciated.
thanks and regards ..
--cameron
 
Saskia Schreiber
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did one time already but i cannot find the source code...but there was one book which helped me very much with this problem.
This is the link. You can download some examples there and there must be one example how to copy one file to another directory. But don't forget to test the file ( if you can read, write, exists etc)
Hope I helped you
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the previous discussion here.
 
satish bora
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try
cmd.exe /c cmd.exe/c copy file1 file2
(Basically you have to get away with windows)
------------------
Sa
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!