Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 4 20:53:01 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.3 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 m853r1Cb030859 for ; Thu, 4 Sep 2008 20:53:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m853pAsG018642 for ; Thu, 4 Sep 2008 20:51:10 -0700 Message-Id: <200809050351.m853pAsG018642@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 warmup1 - md5 Date: Thu, 04 Sep 2008 20:51:10 -0700 From: Bill Cheng Someone wrote: > It is mentioned in the specs to calculate MD5 checksum on the fly but why is > it wrong if i am sending & receving file in blocks of 512 bytes and then > writing these blocks into a file. Since you don't have to have a file, writing into a temporary file may lead to out of disk space or quota problem! You should learn how to do it on the fly withing writing out to a file. > I am doing this because i calculate MD5 > checksum using a subroutine which takes a file pointer. > We can always remove the file once we obtain the md5. You should change your subroutine! And if you do it on the fly, you don't even need a subroutine! If I recall correctly from the grading guidelines, there is nothing there that says that you will lose points by writing to a file. So, if you have to use an external file, please make sure you call mkstemp() or something equivalent and create the file in /tmp. Please also make sure that your code detects out of disk space and quota violation problem! -- Bill Cheng // bill.cheng@usc.edu