Return-Path: william@bourbon.usc.edu
Delivery-Date: Thu Apr 19 22:02:30 2007
X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu
X-Spam-Level: 
X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	NO_REAL_NAME autolearn=ham version=3.1.3
Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75])
	by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id l3K52Ti6019060
	for <cs551@merlot.usc.edu>; Thu, 19 Apr 2007 22:02:29 -0700
Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1])
	by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id l3K52O0i004113
	for <cs551@merlot>; Thu, 19 Apr 2007 22:02:24 -0700
Message-Id: <200704200502.l3K52O0i004113@bourbon.usc.edu>
To: cs551@merlot.usc.edu
Subject: Re: Reg Storage of FileSpec and SignedFileSpec 
Date: Thu, 19 Apr 2007 22:02:24 -0700
From: william@bourbon.usc.edu

Someone wrote:

  > I am not hardcoding it. 
  > I ll explain u in detail what i am doing.
  > 
  > I have a counter which goes on increasing.
  > Whenever i create tempfiles i put them inside homeDir/files/
  > but with the name 
  > 
  > 1)temp1.data,temp1.meta,temp1.cert(whenever i am gettin a get
  >   or store message)
  >   temp2.data...
  > 
  > 2)temp5.meta,temp6.meta...(when ever i get a search response..
  >   which has many meta files)
  > 
  > 3)"i would also like to have temp10.txt,temp11.txt "(for
  >   filespec and signed filespec)- so the name wud not be hardcoded.
  > 
  > So basically i am havin all files in the /homeDir/files/ 
  > And all the temp*.* i would delete in the bbeginning itself.
  > 
  > I have a different counter for permanent and cache files.
  > The permanent and cache data files would be as 1.data,3.data.....
  > 
  > So i am taking care that i never use a filename that i use once.
  > Is this approach rite?

As I've mentioned before, it's fine since you are cleaning
up.  (But I would do things differently for temporary files.
I would call mkstemp() and create these files in /tmp.  Of
course you don't have to take my approach.)
--
Bill Cheng // bill.cheng@usc.edu <URL:http://merlot.usc.edu/william/usc/>




  ----- Original Message -----
  From: william@bourbon.usc.edu
  Date: Thursday, April 19, 2007 12:02 pm
  Subject: Re: Reg Storage of FileSpec and SignedFileSpec
  To: cs551@merlot.usc.edu
  
  > Someone wrote:
  > 
  >  > Can we store the FileSpec and signed filespec any wer in the 
  > homedir?  > can we store it also in the /files/ directory?
  > 
  > You should use /tmp and call mkstemp() or equivalent to get
  > a filename.  Please do *not* hardcode the filename.  Please
  > also remember to delete the file after you are done.
  > --
  > Bill Cheng // bill.cheng@usc.edu 
  > <URL:http://merlot.usc.edu/william/usc/>
