Re: what is canonical path?
From: Ben Wan (bwan0425_at_rogers.com)
Date: 10/07/03
- Next message: Tom Yee: "Re: Including fonts in jar files?"
- Previous message: Oracle3001: "PIxel Information Question"
- In reply to: Phil...: "Re: what is canonical path?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 06 Oct 2003 23:10:12 GMT
yea, I have always try that and it appares that getAbsolutePath() alwasy == to getPath()... so, I had assume all the time that
getAbsolutePath() does nothing...
"Phil..." <rynes@ieee.org> 在郵件 news:QJ7gb.506594$cF.181155@rwcrnsc53 中撰寫...
> I don't want to say that that is it because
> it is supposed to be the same on all machines
> and you have essentially the same thing.
> Win XP is based on Win2k which is
> based on Win NT4.0
>
> Phil...
> "Ben Wan" <bwan0425@rogers.com> wrote in message
> news:iD7gb.235275$Lnr1.148889@news01.bloor.is.net.cable.rogers.com...
> > oh.. i use Win2k with 1.4.1 at home and at school I use win xp with java
> 1.4.1, so you think is only the platform's problem? well, I
> > guess that's life for me... :-(
> >
> >
> > "Phil..." <rynes@ieee.org> 在郵件 news:PZ6gb.503892$Oz4.357379@rwcrnsc54
> 中撰寫...
> > > On my machine it works like John says it should.
> > > I have WIN XP Pro and java 1.4.2
> > > What do you have for OS and Java?
> > >
> > > "Ben Wan" <bwan0425@rogers.com> wrote in message
> > > news:6A6gb.36143$ko%.32339@news04.bloor.is.net.cable.rogers.com...
> > > > "John Kordyback" wrote:
> > > > > getAbsolutePath returns the complete path to the file starting at
> the
> > > > > filesystem root.
> > > >
> > > > if it returns a complete path then how come the following doesn't
> return
> > > the "absolute path"?
> > > > File f = new File(".");
> > > > f.getAbsolutePath(); // return "." and not "c:\folder\folder" ?
> > > > Thx.. ^_^
> > > >
> > > > > getCanonicalPath returns the full path without aliases, shortcuts,
> > > > > shadows or symbolic links. getCanonicalPath resolves those aliases
> to
> > > > > their actual directories.
> > > > >
> > > > > getCanonicalPath throws an IOExceptions when the full path is not
> > > > > available (e.g. the disk in drive A is not ready or the user does
> not
> > > > > have access to the directory). It helps you catch errors before you
> > > > > write into the stream.
> > > > >
> > > > > /qb
> > > > >
> > > > >
> > > > > Ben Wan wrote:
> > > > > > Can anyone please tell me what is canonical path? and why does it
> need
> > > to throws IOexception?
> > > > > > how come getAbsolutePath() doesn't return "c:\folder\folder" but
> > > getCanonicalPath() does?
> > > > > > things I tried using java.io.File
> > > > > > file.getName(); // return "."
> > > > > > file.getAbsolutePath(); // return "."
> > > > > > file.getCanonicalPath(); // return "c:\folder\folder"
> > > > > >
> > > > > >
> > > > > > Thank You Very Much!
> > > > > >
> > > > > > Ben
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
- Next message: Tom Yee: "Re: Including fonts in jar files?"
- Previous message: Oracle3001: "PIxel Information Question"
- In reply to: Phil...: "Re: what is canonical path?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]