aspose file tools
The moose likes Distributed Java and the fly likes Transfer files between different OSs Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Distributed Java
Reply Bookmark "Transfer files between different OSs" Watch "Transfer files between different OSs" New topic
Author

Transfer files between different OSs

Chammi Weerasekera
Greenhorn

Joined: Nov 06, 2006
Posts: 1
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

Joined: Mar 06, 2001
Posts: 13459

"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

Joined: Oct 18, 2000
Posts: 4121

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.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Transfer files between different OSs
 
Similar Threads
Uploading files to phone via Bluetooth
jsch file copy from Linux to Windows
JApplet - works on windows not on Linux
FTP Put a zip file that contains text files in Linux
Transfer files to other Window host