/[gcl]/gcl/o/unixfsys.c
ViewVC logotype

Diff of /gcl/o/unixfsys.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20 by camm, Thu Nov 25 00:06:40 2004 UTC revision 1.21 by camm, Wed May 4 17:40:51 2005 UTC
# Line 372  file_exists(object file) Line 372  file_exists(object file)
372          }          }
373  #endif          #endif        
374    
375          if (stat(filename, &filestatus) >= 0) {          if (stat(filename, &filestatus) >= 0  && !S_ISDIR(filestatus.st_mode)) {
376  #ifdef AIX  #ifdef AIX
377              /* if /tmp/foo is not a directory /tmp/foo/ should not exist */              /* if /tmp/foo is not a directory /tmp/foo/ should not exist */
378              if (filename[strlen(filename)-1] == '/' &&              if (filename[strlen(filename)-1] == '/' &&
# Line 383  file_exists(object file) Line 383  file_exists(object file)
383          } else          } else
384          if (sSAallow_gzipped_fileA->s.s_dbind != sLnil          if (sSAallow_gzipped_fileA->s.s_dbind != sLnil
385                && (strcat(filename,".gz"),                && (strcat(filename,".gz"),
386                    stat(filename, &filestatus) >= 0))                    stat(filename, &filestatus) >= 0 && !S_ISDIR(filestatus.st_mode)))
387              return TRUE;              return TRUE;
388          else          else
389              return(FALSE);              return(FALSE);
390  }  }
391    
392  FILE *  FILE *
393    fopen_not_dir(char *filename,char * option) {
394    
395      struct stat ss;
396    
397      if (!stat(filename,&ss) && S_ISDIR(ss.st_mode))
398        return NULL;
399      else
400        return fopen(filename,option);
401    
402    }
403    
404    FILE *
405  backup_fopen(char *filename, char *option)  backup_fopen(char *filename, char *option)
406  {  {
407          char backupfilename[MAXPATHLEN];          char backupfilename[MAXPATHLEN];
# Line 562  LFD(Lfile_write_date)(void) Line 574  LFD(Lfile_write_date)(void)
574    
575    
576          coerce_to_local_filename(vs_base[0], filename);          coerce_to_local_filename(vs_base[0], filename);
577          if (stat(filename, &filestatus) < 0) { vs_base[0] = Cnil; return;}          if (stat(filename, &filestatus) < 0 || S_ISDIR(filestatus.st_mode))
578              { vs_base[0] = Cnil; return;}
579          vs_base[0] = unix_time_to_universal_time(filestatus.st_mtime);          vs_base[0] = unix_time_to_universal_time(filestatus.st_mtime);
580  }  }
581    
# Line 586  LFD(Lfile_author)(void) Line 599  LFD(Lfile_author)(void)
599          }          }
600    
601          coerce_to_local_filename(vs_base[0], filename);          coerce_to_local_filename(vs_base[0], filename);
602          if (stat(filename, &filestatus) < 0) { vs_base[0] = Cnil; return;}          if (stat(filename, &filestatus) < 0 || S_ISDIR(filestatus.st_mode))
603              { vs_base[0] = Cnil; return;}
604          pwent = getpwuid(filestatus.st_uid);          pwent = getpwuid(filestatus.st_uid);
605          vs_base[0] = pwent ? make_simple_string(pwent->pw_name) : Cnil;          vs_base[0] = pwent ? make_simple_string(pwent->pw_name) : Cnil;
606  #else  #else

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26