Mapper
suspend_it.c
Go to the documentation of this file.
1 #define _POSIX_SOURCE
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <ctype.h>
5 #include <string.h>
6 #include <unistd.h>
7 #include <sys/stat.h>
8 
9 /*---------------------------------------------------------------------
10 
11  FUNCTION: suspend_it
12 
13  PURPOSE: To check if background processes started in proc_loop
14  should be suspended. This function will be called
15  before executing each program started in proc_loop.
16 
17  return values: 0 = file does not exist
18  1 = file exists
19 
20  VERSION and UPDATES
21  1.0 SEP 95 David G. Brandon
22  Original Version
23 
24  *--------------------------------------------------------------------- */
25 
26 
27 suspend_it( char dirname[] )
28 {
29  /*
30  dirname = name of directory to look in
31  */
32 
33  char buff_temp[100];
34  char *suspendfile = "suspend";
35 
36  struct stat buf;
37 
38  sprintf(buff_temp,"%s/%s",dirname,suspendfile);
39 
40  /* Check for existence of the file */
41  if ( stat(buff_temp,&buf) == -1 )
42  return(0);
43  else
44  return(1);
45 
46 }
struct stat buf
Definition: is_file_closed.c:8
sprintf(fbuf,"/usr/mapper/nexrad/ngrid.%02d-%02d-%02d-%02d", year, month, day, hour)
suspend_it(char dirname[])
Definition: suspend_it.c:27