IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33225


Ignore:
Timestamp:
Feb 8, 2012, 2:23:20 PM (14 years ago)
Author:
eugene
Message:

fix copy from function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/CopyFromHostLocation.c

    r33223 r33225  
    1212  char srcname[1024];
    1313  char tgtname[1024];
     14  char outdir[1024];
    1415   
    1516  md5_byte_t srcDigest[NDIGEST];
     
    2829    if (!skylist->regions[i]->hostID) continue;
    2930
    30     // skip catalogs which have not been copied back
    31     if (skylist->regions[i]->hostFlags & DATA_ON_TGT) continue;
     31    // skip catalogs which are not on remote location
     32    if (!(skylist->regions[i]->hostFlags & DATA_ON_TGT)) continue;
    3233
    3334    // skip catalogs which have an uncleared error
     
    4243    int success = TRUE;
    4344
     45    char *subdir = pathname (skylist->regions[i]->name);
     46    sprintf (outdir, "%s/%s", host->pathname, subdir);
     47    free (subdir);
     48
     49    int status = check_dir_access (outdir, DEBUG);
     50    if (!status) {
     51      fprintf (stderr, "failed to find / create target path\n");
     52      exit (2);
     53    }
     54
    4455    char extname[4][16] = {"cpm", "cpt", "cps", "cpn"};
    4556    for (j = 0; success && (j < 4); j++) {
     
    5263
    5364      // check permission to read file
    54       int status = stat (srcname, &filestat);
    55       if (!status) {
     65      status = stat (srcname, &filestat);
     66      if (status) {
    5667        if (errno == ENOENT) continue;  // file does not exist (handle broken table with cpt + cpm but no cpn,cps?)
    5768        perror ("stat:");
Note: See TracChangeset for help on using the changeset viewer.