swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can swarm create a subdirectory


From: Marcus G. Daniels
Subject: Re: can swarm create a subdirectory
Date: 12 Aug 1999 13:01:49 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "PJ" == Paul Johnson <address@hidden> writes:

PJ> Try telling me how to issue stat and mkdir in the middle of a
PJ> swarm prgram.

#import <misc.h> // fopen, stat, mkdir, S_IFDIR

#define DIRNAME "somedir"
#define FILENAME "somefile"

int
main (int argc, const char **argv)
{
  struct stat buf;
  FILE *fp;

  if (stat (DIRNAME, &buf) == -1)
    {
      if (mkdir (DIRNAME, 0700) == -1)
        abort ();
    }
  else if (!(buf.st_mode & S_IFDIR))
    abort ();
  
  if ((fp = fopen (DIRNAME "/" FILENAME, "w")) == NULL)
    abort ();
  
  fputs ("Hello World\n", fp);
}

/*
Local Variables:
compile-command: "/opt/gnu/bin/gcc -o ensuredir -g -Wno-import 
-L/opt/SUNWtcl/8.0/sun4/lib -R/opt/SUNWtcl/8.0/sun4/lib -L/opt/SDGblt/2.4g/lib 
-R/opt/SDGblt/2.4g/lib -L/opt/SDGlibffi/1.20/lib -R/opt/SDGlibffi/1.20/lib 
-L/opt/SDGswarm/1.4.1/lib -L/opt/SDGzlib/1.1.3/lib -L/usr/local/X11/lib 
-R/usr/local/X11/lib -L/usr/openwin/lib -R/usr/openwin/lib 
-L/opt/SDGhdf5/1.0.1/lib -I/opt/SDGswarm/1.4.1/include ensuredir.m -lanalysis 
-lsimtools -lsimtoolsgui -lactivity -ltkobjc -lrandom -lobjectbase  -ldefobj 
-lcollections -lmisc  -ltclobjc -ltk8.0 -ltcl8.0 -lBLT -lsocket -ldl -lnsl 
-L/usr/openwin/lib -lhdf5 -lpng -lz -lXpm -lX11 -lffi -lm -lobjc -lpthread 
-lposix4"
End:
*/

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]