Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 12th, 2006, 03:56 AM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reading the type of file system

Hi,

Does anyone know of any methods in Java that allow you to check what file system is being used by a particular operating system. or how one would go about coding it.

thanking you in advanced

scoobie



Reply With Quote
  #2 (permalink)  
Old June 14th, 2006, 07:06 PM
Authorized User
 
Join Date: Jun 2006
Location: boston, MA, USA.
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can u please eloborate further ?

Reply With Quote
  #3 (permalink)  
Old August 18th, 2009, 09:28 PM
Registered User
 
Join Date: Aug 2009
Location: Dumaguete City
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default

hello!

Does anyone has a java programming that read text file?
Reply With Quote
  #4 (permalink)  
Old August 19th, 2009, 12:06 AM
jomet
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by scoobie View Post
Hi,

Does anyone know of any methods in Java that allow you to check what file system is being used by a particular operating system. or how one would go about coding it.

thanking you in advanced

scoobie
you can identify os using
System.getProperty("os.name");

and can use code like

if(System.getProperty("os.name").indexOf("Windows" )!=-1)
{
filename = "c:\\test.txt";
}
else
{
filename = "/home/test.txt";
}
Reply With Quote
  #5 (permalink)  
Old August 19th, 2009, 12:08 AM
jomet
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by azaira View Post
hello!

Does anyone has a java programming that read text file?
just search google u can get lot of samples..
post your questions in separate thread!!

Sample

import java.io.*;

public class ReadFile{
public static void main(String[] args) throws IOException{
File f;
f=new File("myfile.txt");

if(!f.exists()&& f.length()<0)
System.out.println("The specified file is not exist");

else{
FileInputStream finp=new FileInputStream(f);
byte b;
do{
b=(byte)finp.read();
System.out.print((char)b);
}
while(b!=-1);
finp.close();
}
}
}

from http://www.roseindia.net/java/exampl...-by-line.shtml
Reply With Quote
  #6 (permalink)  
Old August 20th, 2009, 02:35 AM
Registered User
 
Join Date: Aug 2009
Location: Dumaguete City
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default

sorry I didn't mean to put my questions in your thread..I am a new member...
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Guidelines Item 3: Replace System.Type with Type Ixtlia BOOK: Professional .NET 2.0 Generics 0 August 19th, 2007 04:09 AM
Reading the GAC of remote system vikingsunil C# 2005 0 November 6th, 2006 06:25 AM
<input type="File"> - Specify File Type and Path gp_mk Classic ASP Basics 2 August 2nd, 2004 03:07 AM
unhandled exception of type 'System.Net.WebExcepti booksnore2 C# 0 June 26th, 2004 07:26 AM



All times are GMT -4. The time now is 06:33 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.