Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Loading and saving files  RSS feed

 
Martin Vietor
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I want to load a file from CD and save it to disk under a different name. I wil have a list or txt-file or somesuch with the file names (which are sorted) and want to copy them and give them names in said order (file1, file2...) so that Windows will be able to put them in the order I like.

Can you shove me in the right direction? I will gladly do the research myself, I don't want to get out of learning it for myself, but a hinter to not waste time would be nice.

Also: How can I tell which drive in a given computer is the DVD-drive? I am writing this for my Dad who knows so painfully little about computers, I want my program to do as much thinking for him as possible.

Thank you,
Martin
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With java.io.File you can generate a list of files. Copying files can be done by reading from the old location and writing to the new. If you don't know how then check out this tutorial. With File.listRoots(); you can get the roots but I'm not sure how to figure out if it is a cd drive.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!