This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how can I use relative pathname??????

 
leo tien
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one trouble in file path...the java API said: "A pathname, whether abstract or in string form, may be either absolute or relative....."but how can I use relative path???
please help me!!!
thanks before..
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lets say you have a directory path of c:\mydir\src\com\company\gui and in that directory you have a file called filename.ext and you want to retrieve that file and you are in the directory c:\mydir\src, then the relative path is "com\company\gui\filename.ext"
Mark
 
leo tien
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx Mark.
i see, but when the file doesn't exist, it created by the program at runtime..the file can be created in relative path???
 
Rich Raposa
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure. I use relative path all the time. It makes your code portable, and it allows you to add the file to a JAR, where only relative path makes sense.
 
leo tien
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh,my dear Rich..
I'm a fresh ,,,,can you say the method more detailed?? thanx a lot !
[ January 20, 2003: Message edited by: leo tien ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic