Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 13:29:13 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 m9VKTDwh021497 for ; Fri, 31 Oct 2008 13:29:13 -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 m9VKexU2002079 for ; Fri, 31 Oct 2008 13:40:59 -0700 Message-Id: <200810312040.m9VKexU2002079@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: fprintf() Date: Fri, 31 Oct 2008 13:40:59 -0700 From: Bill Cheng Someone wrote: > The status.out file should be stored in the current working directory (where > the code is being run from and where the executable is) right ? That's not the right definition of "current working directory". The "current working directory" of your program is the "working directory" of the shell program when you invoke your program. In your UNIX shell, if you type: pwd it will print out the current working directory of your shell. Let's say that your source and executable are in /home/somewhere/final/part1. I can run your program as follows: cd /tmp pwd /home/somewhere/final/part1/sv_node ~csci551b/public/final1/b1-n00.ini Then /tmp is your "current working directory". How would you know? In your main(), you can do: char current_working_dir[256]; getcwd(current_working_dir, sizeof(current_working_dir)); and current_working_dir will be "/tmp". > When different nodes try to write to the file, sometimes the file is blank > for some nodes...all run the same code ! > > What could be the problem ? Don't know! Debug, debug, debug! -- Bill Cheng // bill.cheng@usc.edu