Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 10 09:43:54 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAAHhs6Z007787 for ; Mon, 10 Nov 2008 09:43:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAAHcpbk010604 for ; Mon, 10 Nov 2008 09:38:51 -0800 Message-Id: <200811101738.mAAHcpbk010604@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : Queries Date: Mon, 10 Nov 2008 09:38:51 -0800 From: Bill Cheng Someone wrote: > I had the following queries about final project part2: > > 1. For the store command, if the user enters a file name which is not > located in the CWD or the path which he specified, what should be the > behavior of the node ? You should tell the user "file not found" or something equivalent. > 2. File ID = A UOID that identifies a file, for getting this file id, do we > have to use the getUOID function with filename and other parameters as the > input? You need to make sure that FileID is unique across the network. Calling GetUOID() is a good way to make sure that it is the case. > 3. A random 20-byte long *one-time password* is first generated. How do we > generate this password ? Can you please explain a bit about this. Do we have > to use the openssl for this? GetUOID() is a good function to use to get a 20-byte long random-looking block of data. In order to make it even *more random*, you should put something random in the obj_type (2nd argument to GetUOID()). You can call gettimeofday() and get the tv_usec field, format it as a string, and pass it as obj_type. > 4. *FileName* - name of the file. Is this the value which the user enters at > the command prompt when the store command is entered ? or say if he entered > /home/scf-07/song.mp3 then we have to take only the "song.mp3" part of it > and store it in this field ? Correct! You can call strrchr() to find the position of the last '/' character in a string. -- Bill Cheng // bill.cheng@usc.edu