• Post Reply Bookmark Topic Watch Topic
  • New Topic

Transfer files between different OSs  RSS feed

 
Chammi Weerasekera
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell me how to write a Java program which makes a text file in Windows XP enabled PC and send the file to a Linux enabled PC. Class file will be on windows environment and When running it has to create the text file and transfer the file to Linux enalbed PC through the network...
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"cha@bigMoose",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with display names get deleted, often without warning

thanks,
Dave
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doing a straight file transfer should be easy - just create the file and either serialize all it's content and send it (if the file is small) or make a file stream (if the file is large). Since the files are specifically text, you may need to do some post-transfer processing if you're planning on viewing them on platforms they weren't created on - you could use Runtime.exec() to call dos2unix/unix2dos on the file, but since all it's really doing is search/replace on text, you could probably implement your own code to do this.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!