OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
read_file_list.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <string.h>
3 
4 int read_file_list(char *filename, char files[][FILENAME_MAX], int maxfiles)
5 /*******************************************************************
6 
7  read_file_list
8 
9  purpose: read a list of file names (or any strings) from a file
10 
11  Returns type: int - count of # files (lines) read
12 
13  Parameters: (in calling order)
14  Type Name I/O Description
15  ---- ---- --- -----------
16  char * filename I name of file with list
17  char[][] files O returned file names
18  int maxfiles I max # files to read
19 
20  Modification history:
21  Programmer Date Description of change
22  ---------- ---- ---------------------
23  B. Franz, SAIC 13 Sep 2002 Original development
24  W. Robinson, SAIC 9 Aug 2004 make a stand-alone routine
25 
26  *******************************************************************/ {
27  FILE *fp = NULL;
28  int nfiles = 0;
29 
30  if ((fp = fopen(filename, "r")) == NULL) {
31  fprintf(stderr,
32  "-W- %s line %d: unable to open %s for reading\n",
33  __FILE__, __LINE__, filename);
34  return (-1);
35  }
36 
37  while (nfiles < maxfiles && (fscanf(fp, "%s\n", files[nfiles]) != EOF))
38  if (strlen(files[nfiles]) > 1)
39  nfiles++;
40 
41  fclose(fp);
42 
43  return (nfiles);
44 }
#define NULL
Definition: decode_rs.h:63
int read_file_list(char *filename, char files[][FILENAME_MAX], int maxfiles)
Definition: read_file_list.c:4
char filename[FILENAME_MAX]
Definition: atrem_corl1.h:122
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed as required for compatibility with version of the SDP toolkit Corrected test output file names to end in per delivery and then split off a new MYD_PR03 pcf file for Aqua Added AssociatedPlatformInstrumentSensor to the inventory metadata in MOD01 mcf and MOD03 mcf Created new versions named MYD01 mcf and MYD03 where AssociatedPlatformShortName is rather than Terra The program itself has been changed to read the Satellite Instrument validate it against the input L1A and LUT files
Definition: HISTORY.txt:442