File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes networked file reading and writing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "networked file reading and writing" Watch "networked file reading and writing" New topic
Author

networked file reading and writing

Joseph Siao
Ranch Hand

Joined: Feb 26, 2004
Posts: 32
Is the use of the FileWriter and FileReader object also applicable if Im writing or reading a file from/to a networked computer or a different computer aside from the computer that im running the java code? or do i have to go to socket programming?
Oliver Gibbs
Greenhorn

Joined: Apr 27, 2004
Posts: 4
If you are reading and writing a file, the network file system should be transparent to your application since the appropriate layer of the operating system will handle the inner details. So in answer to your question, yes, using a FileWriter and FileReader object for network-based files should be suffice!
Hope this helps!
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
Joshep, if you are in LAN is likely that the OS allows you to access files in others computers. If so, FileReader could be used with a file in a shared resource set up previously to the execution of the Java program. But in the Internet we would need socket programming or a FTP client. Look at this post for an example of the former.


SCJP2. Please Indent your code using UBB Code
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: networked file reading and writing
 
Similar Threads
want to replace a value in XML tag
Using javascript in java
Accessing LAN comps through Java
Appending
Couldn't convert HTML to XML file due to Java I/O issue