/[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.13.6.2.12.1 by camm, Sat Jan 15 16:44:37 2005 UTC revision 1.13.6.2.12.1.2.1 by camm, Wed May 4 17:37:27 2005 UTC
# Line 374  file_exists(object file) Line 374  file_exists(object file)
374          }          }
375  #endif          #endif        
376    
377          if (stat(filename, &filestatus) >= 0)          if (stat(filename, &filestatus) >= 0 && !S_ISDIR(filestatus.st_mode))
378            {            {
379  #ifdef AIX  #ifdef AIX
380              /* if /tmp/foo is not a directory /tmp/foo/ should not exist */              /* if /tmp/foo is not a directory /tmp/foo/ should not exist */
# Line 388  file_exists(object file) Line 388  file_exists(object file)
388          else          else
389            if (sSAallow_gzipped_fileA->s.s_dbind != sLnil            if (sSAallow_gzipped_fileA->s.s_dbind != sLnil
390                && (strcat(filename,".gz"),                && (strcat(filename,".gz"),
391                    stat(filename, &filestatus) >= 0))                    stat(filename, &filestatus) >= 0 && !S_ISDIR(filestatus.st_mode)))
392                                
393                return TRUE;                return TRUE;
394    
# Line 397  file_exists(object file) Line 397  file_exists(object file)
397  }  }
398    
399  FILE *  FILE *
400    fopen_not_dir(char *filename,char * option) {
401    
402      struct stat ss;
403    
404      if (!stat(filename,&ss) && S_ISDIR(ss.st_mode))
405        return NULL;
406      else
407        return fopen(filename,option);
408    
409    }
410    
411    FILE *
412  backup_fopen(char *filename, char *option)  backup_fopen(char *filename, char *option)
413  {  {
414          char backupfilename[MAXPATHLEN];          char backupfilename[MAXPATHLEN];
# Line 515  LFD(Lfile_write_date)(void) Line 527  LFD(Lfile_write_date)(void)
527          check_arg(1);          check_arg(1);
528          check_type_or_pathname_string_symbol_stream(&vs_base[0]);          check_type_or_pathname_string_symbol_stream(&vs_base[0]);
529          coerce_to_filename(vs_base[0], filename);          coerce_to_filename(vs_base[0], filename);
530          if (stat(filename, &filestatus) < 0) { vs_base[0] = Cnil; return;}          if (stat(filename, &filestatus) < 0 || S_ISDIR(filestatus.st_mode))
531              { vs_base[0] = Cnil; return;}
532          vs_base[0] = unix_time_to_universal_time(filestatus.st_mtime);          vs_base[0] = unix_time_to_universal_time(filestatus.st_mtime);
533  }  }
534    
# Line 532  LFD(Lfile_author)(void) Line 545  LFD(Lfile_author)(void)
545          check_arg(1);          check_arg(1);
546          check_type_or_pathname_string_symbol_stream(&vs_base[0]);          check_type_or_pathname_string_symbol_stream(&vs_base[0]);
547          coerce_to_filename(vs_base[0], filename);          coerce_to_filename(vs_base[0], filename);
548          if (stat(filename, &filestatus) < 0) { vs_base[0] = Cnil; return;}          if (stat(filename, &filestatus) < 0 || S_ISDIR(filestatus.st_mode))
549              { vs_base[0] = Cnil; return;}
550          pwent = getpwuid(filestatus.st_uid);          pwent = getpwuid(filestatus.st_uid);
551          vs_base[0] = make_simple_string(pwent->pw_name);          vs_base[0] = make_simple_string(pwent->pw_name);
552  #else  #else

Legend:
Removed from v.1.13.6.2.12.1  
changed lines
  Added in v.1.13.6.2.12.1.2.1

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