www.itgalary.com Homepage
Forum Home Forum Home > OS World > Linux
  Active Topics Active Topics
  FAQ FAQ  Forum Search   Register Register  Login Login

java classes in linux

 Post Reply Post Reply
Author
Message
  Topic Search Topic Search  Topic Options Topic Options
sarita View Drop Down
Newbie
Newbie


Joined: 12 Jan 09
Location: pune
Posts: 1
  Quote sarita Quote  Post ReplyReply Direct Link To This Post Topic: java classes in linux
    Posted: 12 Jan 09 at 11:16am
Cry  i badly need the classes for file operation on linux file system....

Back to Top
Jijo View Drop Down
Admin Group
Admin Group
Avatar

Joined: 31 Dec 05
Location: United Kingdom
Posts: 495
  Quote Jijo Quote  Post ReplyReply Direct Link To This Post Posted: 13 Jan 09 at 11:22am
Try this example to read a file on linux system
 
import java.io.*;

BufferedReader bfrRead = new BufferedReader(new FileReader("/home/user/temp/the_file"));
String content = "";
try
{
     while(bfrRead.ready())
     {
          String theLine = bfrRead.readLine();
          content += theLine;
          // Do Stuff
     }

     bfrRead.close();
}
catch(Exception ex)
{
// Now catch the FileNotFoundException and IOException
}
 
System.out.println(content);


Back to Top
ranjithkannikara View Drop Down
Newbie
Newbie
Avatar

Joined: 13 Mar 09
Location: THRISSUR,KERALA
Posts: 1
  Quote ranjithkannikara Quote  Post ReplyReply Direct Link To This Post Posted: 13 Mar 09 at 11:03am
Hi,
 usually the classes in java are just the as in windows.. Almost all the java books for windows will be describing the classes..
Though I am not so much experienced in java have little experience in linux reply if you have any specific doubt..

Regards
Ranju.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

.