• Post Reply Bookmark Topic Watch Topic
  • New Topic

how long does tmp file last

 
Nikos Stavros
Ranch Hand
Posts: 243
Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in the following code

FileOutputStream fos = new FileOutputStream("t.tmp");
ObjectOutputStream oos = new ObjectOutputStream(fos);

oos.writeObject(r1);

will the File t.tmp be deleted automatically after a certain period of time?
 
Nikos Stavros
Ranch Hand
Posts: 243
Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh i have have another question.

what kind of file extensions can you use for saving objects onto your hard disk?

thanks for any help
 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nikos Katsikanis:

will the File t.tmp be deleted automatically after a certain period of time?


No. [java.io.File provides a convenient createTempFile method to create files in the user or system-defined temporary directory and a deleteOnExit method to mark the temp file for deletion, if that is the behavior you desire.
File extensions don't really mean anything. Operating systems like Windows match up particular extensions with programs which can process them, usually along MIME media types (i.e. mapping *.doc to MS Word). There's nothing preventing you from naming a random file to .doc except that Word may choke on the input.
You can name your object storage file whatever you wish, but you should avoid using extensions your OS recognizes.
 
Nikos Stavros
Ranch Hand
Posts: 243
Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok thank you Joe, that was helpful.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!