Re: Easy question but I can't seem to get it to work
- From: TechBookReport <tbr@xxxxxxxxxx>
- Date: Wed, 31 May 2006 14:10:39 +0100
Bjorn Abelli wrote:
"Kevin Ashton" wrote...
I tried typing
FileReader file = new FileReader(c:\javaread\"file.txt");
The path must be included inside the String.
FileReader file = new FileReader("c:\javaread\file.txt");
Backslashes need to be "escaped":
FileReader file = new FileReader("c:\\javaread\\file.txt");
/// Bjorn A
Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
Alternatively use forward slashes "c:/javaread/file.txt". Modern versions of Windows recognise the forward slash as a path separator, and it means you don't have to worry about escaping the backslash.
--
TechBookReport Java http://www.techbookreport.com/JavaIndex.html
.
- References:
- Easy question but I can't seem to get it to work
- From: Kevin Ashton
- Re: Easy question but I can't seem to get it to work
- From: Bart Cremers
- Re: Easy question but I can't seem to get it to work
- From: Kevin Ashton
- Re: Easy question but I can't seem to get it to work
- From: Bjorn Abelli
- Easy question but I can't seem to get it to work
- Prev by Date: Re: Easy question but I can't seem to get it to work
- Next by Date: Re: Where does one report error in Sun's online documentation?
- Previous by thread: Re: Easy question but I can't seem to get it to work
- Next by thread: Re: Easy question but I can't seem to get it to work
- Index(es):
Relevant Pages
|
|