• Post Reply Bookmark Topic Watch Topic
  • New Topic

getAbsolutePath() gives path of a deleted file  RSS feed

 
Rajiv Rai
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Upon first run of the above program i.e when the file MyCode.txt was there in the
file system, its path got printed. Also after the first run the file was deleted.

On the second run , even if the file is deleted . getAbsolutePath() still
gives the path of the now deleted file..

Is the above method behaviour ok?

Thanks
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the API. java.io.File is
An abstract representation of file and directory pathnames.
That doesn't change whether the file exists or not.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!