🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.mac
Article #79

New Patches to CAP (part 2 of 2)

#79
From: Edward Moy
Date: Sun, 04 Jun 1989 17:01
1593 lines
45417 bytes
[New Patches to CAP - part 2 of 2]

---
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#
#	afpos.c.diff
#
# This archive created: Sat Jun  3 07:29:31 1989
# By:	Roger L. Long (bytebug@dhw68k.cts.com)
#
export PATH; PATH=/bin:$PATH
echo shar: extracting "'afpos.c.diff'" '(41043 characters)'
if test -f 'afpos.c.diff'
then
	echo shar: will not over-write existing file "'afpos.c.diff'"
else
sed 's/^X//' << \SHAR_EOF > 'afpos.c.diff'
X*** applications/aufs/afpos.c.orig	Mon Jun 27 12:26:51 1988
X--- applications/aufs/afpos.c	Thu Jan 26 18:10:22 1989
X***************
X*** 112,118
X  #  ifdef Q_GETQUOTA
X  #   define Q_GETDLIM Q_GETQUOTA
X  #  else
X!     You have turned on quotas and aren't using the bsd or sun quota system
X  #  endif /*Q_GETQUOTA*/
X  # endif /* Q_GETDLIM */
X  #endif /* USEQUOTA */
X
X--- 112,118 -----
X  #  ifdef Q_GETQUOTA
X  #   define Q_GETDLIM Q_GETQUOTA
X  #  else
X!     /* You have turned on quotas and aren't using the bsd or sun quota system */
X  #  endif /*Q_GETQUOTA*/
X  # endif /* Q_GETDLIM */
X  #endif /* USEQUOTA */
X***************
X*** 135,140
X  #include "afppasswd.h"			/* in case we are using privates */
X  #include "afposncs.h"
X  #include "afpgc.h"
X  
X  #ifdef MAXBSIZE
X  # define IOBSIZE MAXBSIZE	/* set to max buf entry size by if there */
X
X--- 135,146 -----
X  #include "afppasswd.h"			/* in case we are using privates */
X  #include "afposncs.h"
X  #include "afpgc.h"
X+ #ifdef SIZESERVER
X+ #include <setjmp.h>
X+ #include <signal.h>
X+ #include <sys/socket.h>
X+ #include "sizeserver.h"
X+ #endif SIZESERVER
X  
X  #ifdef MAXBSIZE
X  # define IOBSIZE MAXBSIZE	/* set to max buf entry size by if there */
X***************
X*** 282,287
X  private OSErr ItoEErr();
X  private int filemode();
X  private char *syserr();
X  
X  /*
X   * Enable OS Dependent functions
X
X--- 288,296 -----
X  private OSErr ItoEErr();
X  private int filemode();
X  private char *syserr();
X+ #ifdef SIZESERVER
X+ private void getvolsize();
X+ #endif SIZESERVER
X  
X  /*
X   * Enable OS Dependent functions
X***************
X*** 545,550
X    char path[MAXPATHLEN];
X  
X    OSfname(path,ipdir,file,F_DATA);	/* create data fork name */
X  
X    if (DBOSI)
X      printf("OSDelete file=%s\n",path);
X
X--- 554,562 -----
X    char path[MAXPATHLEN];
X  
X    OSfname(path,ipdir,file,F_DATA);	/* create data fork name */
X+ #ifdef NOCASEMATCH
X+   noCaseMatch(path);
X+ #endif NOCASEMATCH
X  
X    if (DBOSI)
X      printf("OSDelete file=%s\n",path);
X***************
X*** 667,672
X  int typ;
X  {
X    char path[MAXPATHLEN];
X  
X    OSfname(path,pdir,file,typ);		/* build unix file name */
X    return(unix_unlink(path));		/* do the work... */
X
X--- 679,687 -----
X  int typ;
X  {
X    char path[MAXPATHLEN];
X+ #ifdef NOCASEMATCH
X+   register int i;
X+ #endif NOCASEMATCH
X  
X    OSfname(path,pdir,file,typ);		/* build unix file name */
X  #ifdef NOCASEMATCH
X***************
X*** 669,674
X    char path[MAXPATHLEN];
X  
X    OSfname(path,pdir,file,typ);		/* build unix file name */
X    return(unix_unlink(path));		/* do the work... */
X  }
X  
X
X--- 684,696 -----
X  #endif NOCASEMATCH
X  
X    OSfname(path,pdir,file,typ);		/* build unix file name */
X+ #ifdef NOCASEMATCH
X+   if((i = unix_unlink(path)) != noErr) {
X+     noCaseMatch(path);
X+     i = unix_unlink(path);
X+   }
X+   return(i);				/* do the work... */
X+ #else NOCASEMATCH
X    return(unix_unlink(path));		/* do the work... */
X  #endif NOCASEMATCH
X  }
X***************
X*** 670,675
X  
X    OSfname(path,pdir,file,typ);		/* build unix file name */
X    return(unix_unlink(path));		/* do the work... */
X  }
X  
X  
X
X--- 692,698 -----
X    return(i);				/* do the work... */
X  #else NOCASEMATCH
X    return(unix_unlink(path));		/* do the work... */
X+ #endif NOCASEMATCH
X  }
X  
X  
X***************
X*** 743,748
X  IDirP fpdir,tpdir;			/* from and to parent dirs  */
X  char *from,*to;				/* from and to file names */
X  {
X    char fpath[MAXPATHLEN];
X    char tpath[MAXPATHLEN];
X    struct stat stb;
X
X--- 766,773 -----
X  IDirP fpdir,tpdir;			/* from and to parent dirs  */
X  char *from,*to;				/* from and to file names */
X  {
X+   char f_path[MAXPATHLEN];
X+   char t_path[MAXPATHLEN];
X    char fpath[MAXPATHLEN];
X    char tpath[MAXPATHLEN];
X    struct stat stb;
X***************
X*** 748,753
X    struct stat stb;
X    int err,cerr;
X    int mo;
X  
X    OSfname(fpath,fpdir,from,F_DATA);	/* build data file name */
X    OSfname(tpath,tpdir,to,F_DATA);	/* for from and to files */
X
X--- 773,781 -----
X    struct stat stb;
X    int err,cerr;
X    int mo;
X+ #ifdef NOCASEMATCH
X+   register char *pp;
X+ #endif NOCASEMATCH
X  
X    OSfname(f_path,fpdir,from,F_DATA);	/* build data file name */
X    OSfname(t_path,tpdir,to,F_DATA);	/* for from and to files */
X***************
X*** 749,756
X    int err,cerr;
X    int mo;
X  
X!   OSfname(fpath,fpdir,from,F_DATA);	/* build data file name */
X!   OSfname(tpath,tpdir,to,F_DATA);	/* for from and to files */
X  
X    if (DBOSI)
X      printf("OSRename from=%s, to=%s\n",fpath,tpath);
X
X--- 777,784 -----
X    register char *pp;
X  #endif NOCASEMATCH
X  
X!   OSfname(f_path,fpdir,from,F_DATA);	/* build data file name */
X!   OSfname(t_path,tpdir,to,F_DATA);	/* for from and to files */
X  
X    if (DBOSI)
X      printf("OSRename from=%s, to=%s\n",f_path,t_path);
X***************
X*** 753,759
X    OSfname(tpath,tpdir,to,F_DATA);	/* for from and to files */
X  
X    if (DBOSI)
X!     printf("OSRename from=%s, to=%s\n",fpath,tpath);
X  
X    if ((fpdir->flags & DID_FINDERINFO) && (tpdir->flags & DID_FINDERINFO) == 0)
X      return(aeCantMove);
X
X--- 781,787 -----
X    OSfname(t_path,tpdir,to,F_DATA);	/* for from and to files */
X  
X    if (DBOSI)
X!     printf("OSRename from=%s, to=%s\n",f_path,t_path);
X  
X    if ((fpdir->flags & DID_FINDERINFO) && (tpdir->flags & DID_FINDERINFO) == 0)
X      return(aeCantMove);
X***************
X*** 761,766
X      return(aeCantMove);
X  
X    /* must be able to stat destination */
X    if ((err = unix_stat(pathstr(tpdir), &stb)) != noErr)
X      return(err);
X    mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
X
X--- 789,801 -----
X      return(aeCantMove);
X  
X    /* must be able to stat destination */
X+ #ifdef NOCASEMATCH
X+   if ((err = unix_stat(pp = pathstr(tpdir), &stb)) != noErr) {
X+     noCaseFind(pp);
X+     if ((err = unix_stat(pp, &stb)) != noErr)
X+       return(err);
X+   }
X+ #else NOCASEMATCH
X    if ((err = unix_stat(pathstr(tpdir), &stb)) != noErr)
X      return(err);
X  #endif NOCASEMATCH
X***************
X*** 763,768
X    /* must be able to stat destination */
X    if ((err = unix_stat(pathstr(tpdir), &stb)) != noErr)
X      return(err);
X    mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
X  
X    if ((err = unix_stat(fpath,&stb)) != noErr)
X
X--- 798,804 -----
X  #else NOCASEMATCH
X    if ((err = unix_stat(pathstr(tpdir), &stb)) != noErr)
X      return(err);
X+ #endif NOCASEMATCH
X    mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
X  
X  #ifdef NOCASEMATCH
X***************
X*** 765,771
X      return(err);
X    mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
X  
X!   if ((err = unix_stat(fpath,&stb)) != noErr)
X      return(err);
X  
X    err = unix_rename(fpath,tpath);	/* give unix the args */
X
X--- 801,815 -----
X  #endif NOCASEMATCH
X    mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
X  
X! #ifdef NOCASEMATCH
X!   if ((err = unix_stat(f_path,&stb)) != noErr) {
X!     noCaseFind(f_path);
X!     if ((err = unix_stat(f_path,&stb)) != noErr)
X!       return(err);
X!   }
X!   noCaseMatch(t_path);
X! #else NOCASEMATCH
X!   if ((err = unix_stat(f_path,&stb)) != noErr)
X      return(err);
X  #endif NOCASEMATCH
X  
X***************
X*** 767,772
X  
X    if ((err = unix_stat(fpath,&stb)) != noErr)
X      return(err);
X  
X    err = unix_rename(fpath,tpath);	/* give unix the args */
X    if (err != noErr)			/* if an error on data files */
X
X--- 811,817 -----
X  #else NOCASEMATCH
X    if ((err = unix_stat(f_path,&stb)) != noErr)
X      return(err);
X+ #endif NOCASEMATCH
X  
X    err = unix_rename(f_path,t_path);	/* give unix the args */
X    if (err != noErr)			/* if an error on data files */
X***************
X*** 768,774
X    if ((err = unix_stat(fpath,&stb)) != noErr)
X      return(err);
X  
X!   err = unix_rename(fpath,tpath);	/* give unix the args */
X    if (err != noErr)			/* if an error on data files */
X      return(err);			/*  then give up */
X  
X
X--- 813,819 -----
X      return(err);
X  #endif NOCASEMATCH
X  
X!   err = unix_rename(f_path,t_path);	/* give unix the args */
X    if (err != noErr)			/* if an error on data files */
X      return(err);			/*  then give up */
X  
X***************
X*** 775,782
X    if (!S_ISDIR(stb.st_mode)) {		/* directories have no rsrc fork */
X      unix_chmod(tpath, mo);		/* file: try to reset protection */
X      if (fpdir->flags & DID_RESOURCE) {
X!       OSfname(fpath,fpdir,from,F_RSRC);	/* build resource file names */
X!       OSfname(tpath,tpdir,to,F_RSRC);
X        err = unix_rename(fpath,tpath);	/* give unix a shot at it */
X        /* allow non-existant resource */
X        if (err != noErr && err != aeObjectNotFound) { /* error on rename? */
X
X--- 820,829 -----
X    if (!S_ISDIR(stb.st_mode)) {		/* directories have no rsrc fork */
X      unix_chmod(tpath, mo);		/* file: try to reset protection */
X      if (fpdir->flags & DID_RESOURCE) {
X!       strcpy(fpath, f_path);
X!       strcpy(tpath, t_path);
X!       toResFork(fpath,from);			/* build resource file names */
X!       toResFork(tpath,to);
X        err = unix_rename(fpath,tpath);	/* give unix a shot at it */
X        /* allow non-existant resource */
X        if (err != noErr && err != aeObjectNotFound) { /* error on rename? */
X***************
X*** 783,791
X  	if (DBOSI)
X  	  printf("os_rename: failed %s for %s -> %s\n",
X  		 afperr(err),fpath,tpath);
X! 	OSfname(fpath,fpdir,from,F_DATA); /* try to rebuild */
X! 	OSfname(tpath,tpdir,to,F_DATA);
X! 	cerr = unix_rename(tpath,fpath);	/* rename back to orignal */
X  	if (cerr != noErr && DBOSI)
X  	  printf("os_rename: cleanup failed\n");
X  	unix_chmod(tpath, stb.st_mode&0777); /* file:try to reset protection */
X
X--- 830,836 -----
X  	if (DBOSI)
X  	  printf("os_rename: failed %s for %s -> %s\n",
X  		 afperr(err),fpath,tpath);
X! 	cerr = unix_rename(t_path,f_path);	/* rename back to orignal */
X  	if (cerr != noErr && DBOSI)
X  	  printf("os_rename: cleanup failed\n");
X  	unix_chmod(t_path, stb.st_mode&0777); /* file:try to reset protection */
X***************
X*** 788,794
X  	cerr = unix_rename(tpath,fpath);	/* rename back to orignal */
X  	if (cerr != noErr && DBOSI)
X  	  printf("os_rename: cleanup failed\n");
X! 	unix_chmod(tpath, stb.st_mode&0777); /* file:try to reset protection */
X  	return(err);
X        }
X      }
X
X--- 833,839 -----
X  	cerr = unix_rename(t_path,f_path);	/* rename back to orignal */
X  	if (cerr != noErr && DBOSI)
X  	  printf("os_rename: cleanup failed\n");
X! 	unix_chmod(t_path, stb.st_mode&0777); /* file:try to reset protection */
X  	return(err);
X        }
X      }
X***************
X*** 795,802
X    }  
X  
X    if (fpdir->flags & DID_FINDERINFO) {
X!     OSfname(fpath,fpdir,from,F_FNDR);	/* build finder info file names */
X!     OSfname(tpath,tpdir,to,F_FNDR);
X      err = unix_rename(fpath,tpath);	/* give unix a shot at it */
X      if (err != noErr && DBOSI) {
X        printf("os_rename: failed %s for %s -> %s\n", afperr(err),fpath,tpath);
X
X--- 840,849 -----
X    }  
X  
X    if (fpdir->flags & DID_FINDERINFO) {
X!     strcpy(fpath, f_path);
X!     strcpy(tpath, t_path);
X!     toFinderInfo(fpath,from);		/* build finder info file names */
X!     toFinderInfo(tpath,to);
X      err = unix_rename(fpath,tpath);	/* give unix a shot at it */
X      if (err != noErr && DBOSI) {
X        printf("os_rename: failed %s for %s -> %s\n", afperr(err),fpath,tpath);
X***************
X*** 1047,1052
X  					/* want path/name */
X  
X    OSfname(path, pdir, name, F_DATA);	/* get path/name */
X    switch (typ) {
X    case F_RSRC:
X      strcat(path, "/");
X
X--- 1094,1102 -----
X  					/* want path/name */
X  
X    OSfname(path, pdir, name, F_DATA);	/* get path/name */
X+ #ifdef NOCASEMATCH
X+   noCaseMatch(path);
X+ #endif NOCASEMATCH
X    switch (typ) {
X    case F_RSRC:
X      strcat(path, RFDIR);
X***************
X*** 1049,1056
X    OSfname(path, pdir, name, F_DATA);	/* get path/name */
X    switch (typ) {
X    case F_RSRC:
X!     strcat(path, "/");
X!     strcat(path, RFDIRFN);
X      break;
X    case F_FNDR:
X      strcat(path, "/");
X
X--- 1099,1105 -----
X  #endif NOCASEMATCH
X    switch (typ) {
X    case F_RSRC:
X!     strcat(path, RFDIR);
X      break;
X    case F_FNDR:
X      strcat(path, FIDIR);
X***************
X*** 1053,1060
X      strcat(path, RFDIRFN);
X      break;
X    case F_FNDR:
X!     strcat(path, "/");
X!     strcat(path, FIDIRFN);
X      break;
X    }
X    if (DBOSI)
X
X--- 1102,1108 -----
X      strcat(path, RFDIR);
X      break;
X    case F_FNDR:
X!     strcat(path, FIDIR);
X      break;
X    }
X    if (DBOSI)
X***************
X*** 1090,1095
X  
X    if (pdir->flags  & DID_FINDERINFO) {
X      OSfname(path,pdir,name,F_FNDR);	/* create finderinfo for folder */
X      err = unix_create(path,TRUE,mo);	/*  do delete if exists... */
X      os_mkdir(pdir,name,mo,F_FNDR);	/* create the finderinfo directory */
X    }
X
X--- 1138,1146 -----
X  
X    if (pdir->flags  & DID_FINDERINFO) {
X      OSfname(path,pdir,name,F_FNDR);	/* create finderinfo for folder */
X+ #ifdef NOCASEMATCH
X+     noCaseMatch(path);
X+ #endif NOCASEMATCH
X      err = unix_create(path,TRUE,mo);	/*  do delete if exists... */
X      os_mkdir(pdir,name,mo,F_FNDR);	/* create the finderinfo directory */
X    }
X***************
X*** 1130,1135
X      printf("OSFileDirInfo on %s\n",path);
X  
X    if (stat(path,&buf) != 0) {		/* file exists? */
X      if (idir)				/* was in directory tree? */
X        Idrdirid(ipdir, idir);		/* invalidate the entry then */
X      return(aeObjectNotFound);		/* no... */
X
X--- 1181,1194 -----
X      printf("OSFileDirInfo on %s\n",path);
X  
X    if (stat(path,&buf) != 0) {		/* file exists? */
X+ #ifdef NOCASEMATCH
X+     noCaseFind(path);			/* case-insensitive */
X+     if (stat(path,&buf) != 0) {		/* file exists? */
X+       if (idir)				/* was in directory tree? */
X+         Idrdirid(ipdir, idir);		/* invalidate the entry then */
X+       return(aeObjectNotFound);		/* no... */
X+     }
X+ #else NOCASEMATCH
X      if (idir)				/* was in directory tree? */
X        Idrdirid(ipdir, idir);		/* invalidate the entry then */
X      return(aeObjectNotFound);		/* no... */
X***************
X*** 1133,1138
X      if (idir)				/* was in directory tree? */
X        Idrdirid(ipdir, idir);		/* invalidate the entry then */
X      return(aeObjectNotFound);		/* no... */
X    }
X  
X    /* pick out the earliest date for mac creation time */
X
X--- 1192,1198 -----
X      if (idir)				/* was in directory tree? */
X        Idrdirid(ipdir, idir);		/* invalidate the entry then */
X      return(aeObjectNotFound);		/* no... */
X+ #endif NOCASEMATCH
X    }
X  
X    /* pick out the earliest date for mac creation time */
X***************
X*** 1155,1161
X      return(OSDirInfo(ipdir,fn,fdp,&buf,volid));	/* fill in */
X    }
X    fdp->fdp_flg = 0;			/* otherwise a file */
X!   return(OSFileInfo(ipdir,fn,fdp,&buf)); /* fill in */
X  }
X  
X    
X
X--- 1215,1221 -----
X      return(OSDirInfo(ipdir,fn,fdp,&buf,volid));	/* fill in */
X    }
X    fdp->fdp_flg = 0;			/* otherwise a file */
X!   return(OSFileInfo(ipdir,fn,fdp,&buf,path)); /* fill in */
X  }
X  
X    
X***************
X*** 1222,1227
X  IDirP idirid;
X  {
X    char path[MAXPATHLEN];
X    struct stat stb;
X    IDirP pdir;
X    int i;
X
X--- 1282,1288 -----
X  IDirP idirid;
X  {
X    char path[MAXPATHLEN];
X+   char p_ath[MAXPATHLEN];
X    struct stat stb;
X    IDirP pdir;
X    int i;
X***************
X*** 1226,1233
X    IDirP pdir;
X    int i;
X  
X!   OSfname(path,idirid,"",F_DATA);
X!   if (stat(path, &stb) == 0) {
X      if (S_ISDIR(stb.st_mode))
X        idirid->flags |= DID_DATA;
X  #ifndef NOLSTAT
X
X--- 1287,1301 -----
X    IDirP pdir;
X    int i;
X  
X!   OSfname(p_ath,idirid,"",F_DATA);
X!   i = stat(p_ath, &stb);
X! #ifdef NOCASEMATCH
X!   if(i != 0) {
X!     noCaseFind(p_ath);
X!     i = stat(p_ath, &stb);
X!   }
X! #endif NOCASEMATCH
X!   if (i == 0) {
X      if (S_ISDIR(stb.st_mode))
X        idirid->flags |= DID_DATA;
X  #ifndef NOLSTAT
X***************
X*** 1231,1237
X      if (S_ISDIR(stb.st_mode))
X        idirid->flags |= DID_DATA;
X  #ifndef NOLSTAT
X!     if (lstat(path, &stb) != 0) { /* shouldn't fail! */
X        idirid->flags = DID_VALID;
X        return;
X      }
X
X--- 1299,1305 -----
X      if (S_ISDIR(stb.st_mode))
X        idirid->flags |= DID_DATA;
X  #ifndef NOLSTAT
X!     if (lstat(p_ath, &stb) != 0) { /* shouldn't fail! */
X        idirid->flags = DID_VALID;
X        return;
X      }
X***************
X*** 1249,1256
X        idirid->flags |= ((i << DID_SYMLINKS_SHIFT) & DID_SYMLINKS);
X      }
X      /* don't follow symbolic links here! */
X!     OSfname(path,idirid,"",F_FNDR);
X!     if (lstat(path, &stb) == 0) 
X        if (S_ISDIR(stb.st_mode))
X  	idirid->flags |= DID_FINDERINFO;
X      OSfname(path,idirid,"",F_RSRC);
X
X--- 1317,1325 -----
X        idirid->flags |= ((i << DID_SYMLINKS_SHIFT) & DID_SYMLINKS);
X      }
X      /* don't follow symbolic links here! */
X!     strcpy(path,p_ath);
X!     toFinderInfo(path,"");
X!     if (lstat(path, &stb) == 0)
X        if (S_ISDIR(stb.st_mode))
X  	idirid->flags |= DID_FINDERINFO;
X      strcpy(path,p_ath);
X***************
X*** 1253,1260
X      if (lstat(path, &stb) == 0) 
X        if (S_ISDIR(stb.st_mode))
X  	idirid->flags |= DID_FINDERINFO;
X!     OSfname(path,idirid,"",F_RSRC);
X!     if (lstat(path, &stb) == 0)  
X        if (S_ISDIR(stb.st_mode))
X  	idirid->flags |= DID_RESOURCE;
X  #else
X
X--- 1322,1330 -----
X      if (lstat(path, &stb) == 0)
X        if (S_ISDIR(stb.st_mode))
X  	idirid->flags |= DID_FINDERINFO;
X!     strcpy(path,p_ath);
X!     toResFork(path,"");
X!     if (lstat(path, &stb) == 0)
X        if (S_ISDIR(stb.st_mode))
X  	idirid->flags |= DID_RESOURCE;
X  #else
X***************
X*** 1259,1266
X  	idirid->flags |= DID_RESOURCE;
X  #else
X      /* no symolic links then */
X!     OSfname(path,idirid,"",F_FNDR);
X!     if (stat(path, &stb) == 0) 
X        if (S_ISDIR(stb.st_mode))
X  	idirid->flags |= DID_FINDERINFO;
X      OSfname(path,idirid,"",F_RSRC);
X
X--- 1329,1337 -----
X  	idirid->flags |= DID_RESOURCE;
X  #else
X      /* no symolic links then */
X!     strcpy(path,p_ath);
X!     toFinderInfo(path,"");
X!     if (stat(path, &stb) == 0)
X        if (S_ISDIR(stb.st_mode))
X  	idirid->flags |= DID_FINDERINFO;
X      strcpy(path,p_ath);
X***************
X*** 1263,1270
X      if (stat(path, &stb) == 0) 
X        if (S_ISDIR(stb.st_mode))
X  	idirid->flags |= DID_FINDERINFO;
X!     OSfname(path,idirid,"",F_RSRC);
X!     if (stat(path, &stb) == 0)  
X        if (S_ISDIR(stb.st_mode))
X  	idirid->flags |= DID_RESOURCE;
X  #endif
X
X--- 1334,1342 -----
X      if (stat(path, &stb) == 0)
X        if (S_ISDIR(stb.st_mode))
X  	idirid->flags |= DID_FINDERINFO;
X!     strcpy(path,p_ath);
X!     toResFork(path,"");
X!     if (stat(path, &stb) == 0)
X        if (S_ISDIR(stb.st_mode))
X  	idirid->flags |= DID_RESOURCE;
X  #endif
X***************
X*** 1273,1279
X  }
X  
X  export OSErr
X! OSFileInfo(ipdir,fn,fdp,buf)
X  IDirP ipdir;
X  char *fn;
X  FileDirParm *fdp;
X
X--- 1345,1351 -----
X  }
X  
X  export OSErr
X! OSFileInfo(ipdir,fn,fdp,buf,rpath)
X  IDirP ipdir;
X  char *fn,*rpath;
X  FileDirParm *fdp;
X***************
X*** 1275,1281
X  export OSErr
X  OSFileInfo(ipdir,fn,fdp,buf)
X  IDirP ipdir;
X! char *fn;
X  FileDirParm *fdp;
X  struct stat *buf;
X  {
X
X--- 1347,1353 -----
X  export OSErr
X  OSFileInfo(ipdir,fn,fdp,buf,rpath)
X  IDirP ipdir;
X! char *fn,*rpath;
X  FileDirParm *fdp;
X  struct stat *buf;
X  {
X***************
X*** 1280,1286
X  struct stat *buf;
X  {
X    struct stat stb;
X-   char rpath[MAXPATHLEN];
X    word bm;
X  
X    fdp->fdp_fbitmap &= FP_AUFS_VALID; /* truncate to aufs supported */
X
X--- 1352,1357 -----
X  struct stat *buf;
X  {
X    struct stat stb;
X    word bm;
X  
X    fdp->fdp_fbitmap &= FP_AUFS_VALID; /* truncate to aufs supported */
X***************
X*** 1300,1306
X    fdp->fdp_parms.fp_parms.fp_rflen = 0;
X  
X    if (bm & FP_RFLEN) {
X!     OSfname(rpath,ipdir,fn,F_RSRC);	/* convert to rsrc name */
X      if (stat(rpath,&stb) != 0)		/* to figure size of resource fork */
X        return(noErr);
X      if (DBFIL)
X
X--- 1371,1377 -----
X    fdp->fdp_parms.fp_parms.fp_rflen = 0;
X  
X    if (bm & FP_RFLEN) {
X!     toResFork(rpath,fn);		/* convert to rsrc name */
X      if (stat(rpath,&stb) != 0)		/* to figure size of resource fork */
X        return(noErr);
X      if (DBFIL)
X***************
X*** 1322,1327
X  {
X    char path[MAXPATHLEN];  
X    struct stat stb;
X  
X    OSfname(path, ipdir, fn, type);
X    return(unix_stat(path, &stb));
X
X--- 1393,1401 -----
X  {
X    char path[MAXPATHLEN];  
X    struct stat stb;
X+ #ifdef NOCASEMATCH
X+   register int i;
X+ #endif NOCASEMATCH
X  
X    OSfname(path, ipdir, fn, type);
X  #ifdef NOCASEMATCH
X***************
X*** 1324,1329
X    struct stat stb;
X  
X    OSfname(path, ipdir, fn, type);
X    return(unix_stat(path, &stb));
X  }
X  
X
X--- 1398,1410 -----
X  #endif NOCASEMATCH
X  
X    OSfname(path, ipdir, fn, type);
X+ #ifdef NOCASEMATCH
X+   if((i = unix_stat(path, &stb)) != noErr) {
X+     noCaseFind(path);
X+     i = unix_stat(path, &stb);
X+   }
X+   return(i);
X+ #else NOCASEMATCH
X    return(unix_stat(path, &stb));
X  #endif NOCASEMATCH
X  }
X***************
X*** 1325,1330
X  
X    OSfname(path, ipdir, fn, type);
X    return(unix_stat(path, &stb));
X  }
X  
X  export OSErr
X
X--- 1406,1412 -----
X    return(i);
X  #else NOCASEMATCH
X    return(unix_stat(path, &stb));
X+ #endif NOCASEMATCH
X  }
X  
X  export OSErr
X***************
X*** 1340,1345
X  
X    OSfname(path,ipdir,fn,F_DATA);	/* unix file name */
X    if ((err = unix_stat(path,&stb)) != noErr) {
X      /* can't find it !!! */
X      if (idir)
X        Idrdirid(ipdir, idir);		/* remove from tree */
X
X--- 1422,1436 -----
X  
X    OSfname(path,ipdir,fn,F_DATA);	/* unix file name */
X    if ((err = unix_stat(path,&stb)) != noErr) {
X+ #ifdef NOCASEMATCH
X+     noCaseFind(path);
X+     if ((err = unix_stat(path,&stb)) != noErr) {
X+       /* can't find it !!! */
X+       if (idir)
X+         Idrdirid(ipdir, idir);		/* remove from tree */
X+       return(err);
X+     }
X+ #else NOCASEMATCH
X      /* can't find it !!! */
X      if (idir)
X        Idrdirid(ipdir, idir);		/* remove from tree */
X***************
X*** 1344,1349
X      if (idir)
X        Idrdirid(ipdir, idir);		/* remove from tree */
X      return(err);
X    }
X  
X    if (S_ISDIR(stb.st_mode))		/* if a directory */
X
X--- 1435,1441 -----
X      if (idir)
X        Idrdirid(ipdir, idir);		/* remove from tree */
X      return(err);
X+ #endif NOCASEMATCH
X    }
X  
X    if (S_ISDIR(stb.st_mode))		/* if a directory */
X***************
X*** 1378,1383
X  FileDirParm *fdp;
X  {
X    u_short EtoIAccess();
X    char path[MAXPATHLEN];
X    int own,grp,err;			/* owner and group ids */
X    DirParm *dp = &fdp->fdp_parms.dp_parms;
X
X--- 1470,1476 -----
X  FileDirParm *fdp;
X  {
X    u_short EtoIAccess();
X+   char p_ath[MAXPATHLEN];
X    char path[MAXPATHLEN];
X    int own,grp,err;			/* owner and group ids */
X    DirParm *dp = &fdp->fdp_parms.dp_parms;
X***************
X*** 1395,1402
X    flags = ipdir->flags;		/* should use to prevent overworking */
X    if (own != -1 || grp != -1) {
X      /* error recovery? do all just in case */
X!     OSfname(path,ipdir,fn,F_DATA);	/* change unix name */
X!     if ((err = unix_chown(path,own,grp)) != noErr)
X        return(err);
X      OSfname(path,ipdir,fn,F_RSRC);	/* change unix name */
X      if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound)
X
X--- 1488,1502 -----
X    flags = ipdir->flags;		/* should use to prevent overworking */
X    if (own != -1 || grp != -1) {
X      /* error recovery? do all just in case */
X!     OSfname(p_ath,ipdir,fn,F_DATA);	/* change unix name */
X! #ifdef NOCASEMATCH
X!     if ((err = unix_chown(p_ath,own,grp)) != noErr) {
X!       noCaseFind(p_ath);
X!       if ((err = unix_chown(p_ath,own,grp)) != noErr)
X!         return(err);
X!     }
X! #else NOCASEMATCH
X!     if ((err = unix_chown(p_ath,own,grp)) != noErr)
X        return(err);
X  #endif NOCASEMATCH
X      strcpy(path,p_ath);
X***************
X*** 1398,1404
X      OSfname(path,ipdir,fn,F_DATA);	/* change unix name */
X      if ((err = unix_chown(path,own,grp)) != noErr)
X        return(err);
X!     OSfname(path,ipdir,fn,F_RSRC);	/* change unix name */
X      if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound)
X        return(err);
X      OSfname(path,ipdir,fn,F_FNDR);	/* create unix name */
X
X--- 1498,1506 -----
X  #else NOCASEMATCH
X      if ((err = unix_chown(p_ath,own,grp)) != noErr)
X        return(err);
X! #endif NOCASEMATCH
X!     strcpy(path,p_ath);
X!     toResFork(path,fn);
X      if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound)
X        return(err);
X      strcpy(path,p_ath);
X***************
X*** 1401,1407
X      OSfname(path,ipdir,fn,F_RSRC);	/* change unix name */
X      if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound)
X        return(err);
X!     OSfname(path,ipdir,fn,F_FNDR);	/* create unix name */
X      if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound)
X        return(err);
X      EModified(ipdir);
X
X--- 1503,1510 -----
X      toResFork(path,fn);
X      if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound)
X        return(err);
X!     strcpy(path,p_ath);
X!     toFinderInfo(path,fn);
X      if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound)
X        return(err);
X      EModified(ipdir);
X***************
X*** 1473,1478
X      printf("os_chmod: setting %o for %s\n",mode,path);
X  
X    err = unix_chmod(path,mode);		/* and set for the directory */
X    if (err != noErr)
X      return(err);
X  
X
X--- 1576,1588 -----
X      printf("os_chmod: setting %o for %s\n",mode,path);
X  
X    err = unix_chmod(path,mode);		/* and set for the directory */
X+ #ifdef NOCASEMATCH
X+   if (err != noErr) {
X+     noCaseFind(path);
X+     if((err = unix_chmod(path,mode)) != noErr)
X+       return(err);
X+   }
X+ #else NOCASEMATCH
X    if (err != noErr)
X      return(err);
X  #endif NOCASEMATCH
X***************
X*** 1475,1480
X    err = unix_chmod(path,mode);		/* and set for the directory */
X    if (err != noErr)
X      return(err);
X  
X    EModified(idir);
X    return(noErr);
X
X--- 1585,1591 -----
X  #else NOCASEMATCH
X    if (err != noErr)
X      return(err);
X+ #endif NOCASEMATCH
X  
X    EModified(idir);
X    return(noErr);
X***************
X*** 1510,1517
X    case F_DATA:
X      break;
X    case F_RSRC:
X!     path[pl] = '/';
X!     strcpy(path+pl+1, RFDIRFN);
X      break;
X    case F_FNDR:
X      path[pl] = '/';
X
X--- 1621,1627 -----
X    case F_DATA:
X      break;
X    case F_RSRC:
X!     strcpy(path+pl, RFDIR);
X      break;
X    case F_FNDR:
X      strcpy(path+pl, FIDIR);
X***************
X*** 1514,1521
X      strcpy(path+pl+1, RFDIRFN);
X      break;
X    case F_FNDR:
X!     path[pl] = '/';
X!     strcpy(path+pl+1, FIDIRFN);
X      break;
X    }
X    if (DBOSI)
X
X--- 1624,1630 -----
X      strcpy(path+pl, RFDIR);
X      break;
X    case F_FNDR:
X!     strcpy(path+pl, FIDIR);
X      break;
X    }
X    if (DBOSI)
X***************
X*** 1522,1527
X      printf("os_chmod: setting %o for %s\n",mode,path);
X  
X    dirp = opendir(path);
X    if (dirp == NULL) {
X      if (DBOSI)
X        printf("os_chmod: opendir failed on %s\n",path);
X
X--- 1631,1637 -----
X      printf("os_chmod: setting %o for %s\n",mode,path);
X  
X    dirp = opendir(path);
X+ #ifdef NOCASEMATCH
X    if (dirp == NULL) {
X      noCaseFind(path);
X      if((dirp = opendir(path)) == NULL) {
X***************
X*** 1523,1528
X  
X    dirp = opendir(path);
X    if (dirp == NULL) {
X      if (DBOSI)
X        printf("os_chmod: opendir failed on %s\n",path);
X      return;
X
X--- 1633,1647 -----
X    dirp = opendir(path);
X  #ifdef NOCASEMATCH
X    if (dirp == NULL) {
X+     noCaseFind(path);
X+     if((dirp = opendir(path)) == NULL) {
X+       if (DBOSI)
X+         printf("os_chmod: opendir failed on %s\n",path);
X+       return;
X+     }
X+   }
X+ #else NOCASEMATCH
X+   if (dirp == NULL) {
X      if (DBOSI)
X        printf("os_chmod: opendir failed on %s\n",path);
X      return;
X***************
X*** 1527,1532
X        printf("os_chmod: opendir failed on %s\n",path);
X      return;
X    }
X  
X    pl = strlen(path);			/* length of the path */
X    path[pl++] = '/';			/* add component terminator */
X
X--- 1646,1652 -----
X        printf("os_chmod: opendir failed on %s\n",path);
X      return;
X    }
X+ #endif NOCASEMATCH
X  
X    pl = strlen(path);			/* length of the path */
X    path[pl++] = '/';			/* add component terminator */
X***************
X*** 1706,1711
X    err = access(path,imode);
X    if (err == 0)
X      return(noErr);
X    switch (errno) {
X    case ENOTDIR:
X      return(aeDirNotFound);
X
X--- 1826,1836 -----
X    err = access(path,imode);
X    if (err == 0)
X      return(noErr);
X+ #ifdef NOCASEMATCH
X+   noCaseFind(path);
X+   if(access(path,imode) == 0)
X+     return(noErr);
X+ #endif NOCASEMATCH
X    switch (errno) {
X    case ENOTDIR:
X      return(aeDirNotFound);
X***************
X*** 1834,1839
X      return(noErr);
X    }
X  #endif
X    v->v_size = 0x1000000;		/* some random number */
X    v->v_free = 0x1000000;		/* same random number */
X    return(noErr);			/* all ok */
X
X--- 1959,1967 -----
X      return(noErr);
X    }
X  #endif
X+ #ifdef SIZESERVER
X+   getvolsize(path, &v->v_size, &v->v_free);
X+ #else SIZESERVER
X    v->v_size = 0x1000000;		/* some random number */
X    v->v_free = 0x1000000;		/* same random number */
X  #endif SIZESERVER
X***************
X*** 1836,1841
X  #endif
X    v->v_size = 0x1000000;		/* some random number */
X    v->v_free = 0x1000000;		/* same random number */
X    return(noErr);			/* all ok */
X  }
X  
X
X--- 1964,1970 -----
X  #else SIZESERVER
X    v->v_size = 0x1000000;		/* some random number */
X    v->v_free = 0x1000000;		/* same random number */
X+ #endif SIZESERVER
X    return(noErr);			/* all ok */
X  }
X  
X***************
X*** 1839,1844
X    return(noErr);			/* all ok */
X  }
X  
X  #ifdef USEGETMNT
X  /* get info on path using buf when there is ambiguity (ultrix 2.0 or before) */
X  /* fill in info on v */
X
X--- 1968,2043 -----
X    return(noErr);			/* all ok */
X  }
X  
X+ #ifdef SIZESERVER
X+ static jmp_buf gotpipe;
X+ 
X+ private void
X+ getvolsize(path, ntot, nfree)
X+ char *path;
X+ sdword *ntot, *nfree;
X+ {
X+ 	register int i;
X+ 	int mask, socket[2];
X+ 	struct volsize vs;
X+ 	static int server = -1, server1, servmask;
X+ 	static struct timeval servtimeout = {0, 500000L};
X+ 
X+ 	if(setjmp(gotpipe)) {
X+ 		if(server >= 0)
X+ 			close(server);
X+ 		server = -1;
X+ unknown:
X+ 		*ntot = 0x1000000;
X+ 		*nfree = 0x1000000;
X+ 		return;
X+ 	}
X+ 	if(server < 0) {
X+ 		register int pid;
X+ 		int catchsigpipe();
X+ 
X+ 		if(socketpair(AF_UNIX, SOCK_STREAM, 0, socket) < 0)
X+ 			goto unknown;
X+ 		if((pid = fork()) < 0) {
X+ 			close(socket[0]);
X+ 			close(socket[1]);
X+ 			goto unknown;
X+ 		}
X+ 		if(pid == 0) {	/* the child */
X+ 			close(socket[0]);
X+ 			if(socket[1] != 0) {
X+ 				dup2(socket[1], 0);
X+ 				close(socket[1]);
X+ 			}
X+ 			execl(SIZESERVER, SIZESERVER, 0);
X+ 			_exit(1);
X+ 		}
X+ 		close(socket[1]);
X+ 		server = socket[0];
X+ 		server1 = server + 1;
X+ 		servmask = 1 << server;
X+ 		signal(SIGPIPE, catchsigpipe);
X+ 	}
X+ 	for(i = 3 ; ; ) {
X+ 		if(i-- <= 0)
X+ 			goto unknown;
X+ 		lseek(server, 0L, 2);
X+ 		write(server, path, strlen(path) + 1);
X+ 		mask = servmask;
X+ 		if(select(server1, &mask, NULL, NULL, &servtimeout) < 1)
X+ 			goto unknown;
X+ 		if(read(server, (char *)&vs, sizeof(vs)) == sizeof(vs))
X+ 			break;
X+ 	}
X+ 	*ntot = vs.total;
X+ 	*nfree = vs.free;
X+ }
X+ 
X+ catchsigpipe()
X+ {
X+ 	longjmp(gotpipe, 1);
X+ }
X+ #endif SIZESERVER
X+ 
X  #ifdef USEGETMNT
X  /* get info on path using buf when there is ambiguity (ultrix 2.0 or before) */
X  /* fill in info on v */
X***************
X*** 2064,2069
X  IDirP spdir,dpdir;			/* source and destination parents */
X  char *sfile,*dfile;			/* source and destination file names */
X  {
X    char spath[MAXPATHLEN];
X    char dpath[MAXPATHLEN];
X    struct stat stb;
X
X--- 2263,2270 -----
X  IDirP spdir,dpdir;			/* source and destination parents */
X  char *sfile,*dfile;			/* source and destination file names */
X  {
X+   char s_path[MAXPATHLEN];
X+   char d_path[MAXPATHLEN];
X    char spath[MAXPATHLEN];
X    char dpath[MAXPATHLEN];
X    struct stat stb;
X***************
X*** 2070,2077
X    int mo;
X    int err;
X  
X!   OSfname(spath,spdir,sfile,F_DATA);	/* create unix style name for data */
X!   OSfname(dpath,dpdir,dfile,F_DATA);	/*  same for destination */
X  
X    if (DBOSI)
X      printf("OSCopyFile: %s -> %s\n",spath,dpath);
X
X--- 2271,2284 -----
X    int mo;
X    int err;
X  
X!   OSfname(s_path,spdir,sfile,F_DATA);	/* create unix style name for data */
X! #ifdef NOCASEMATCH
X!   noCaseMatch(s_path);
X! #endif NOCASEMATCH
X!   OSfname(d_path,dpdir,dfile,F_DATA);	/*  same for destination */
X! #ifdef NOCASEMATCH
X!   noCaseMatch(d_path);
X! #endif NOCASEMATCH
X  
X    if (DBOSI)
X      printf("OSCopyFile: %s -> %s\n",s_path,d_path);
X***************
X*** 2074,2080
X    OSfname(dpath,dpdir,dfile,F_DATA);	/*  same for destination */
X  
X    if (DBOSI)
X!     printf("OSCopyFile: %s -> %s\n",spath,dpath);
X  
X    err = unix_stat(dpath,&stb);		/* see if destination exists... */
X    if (err == noErr)			/* yes... it does */
X
X--- 2281,2287 -----
X  #endif NOCASEMATCH
X  
X    if (DBOSI)
X!     printf("OSCopyFile: %s -> %s\n",s_path,d_path);
X  
X    err = unix_stat(d_path,&stb);		/* see if destination exists... */
X    if (err == noErr)			/* yes... it does */
X***************
X*** 2076,2082
X    if (DBOSI)
X      printf("OSCopyFile: %s -> %s\n",spath,dpath);
X  
X!   err = unix_stat(dpath,&stb);		/* see if destination exists... */
X    if (err == noErr)			/* yes... it does */
X      return(aeObjectExists);		/* return error... */
X  
X
X--- 2283,2289 -----
X    if (DBOSI)
X      printf("OSCopyFile: %s -> %s\n",s_path,d_path);
X  
X!   err = unix_stat(d_path,&stb);		/* see if destination exists... */
X    if (err == noErr)			/* yes... it does */
X      return(aeObjectExists);		/* return error... */
X  
X***************
X*** 2084,2090
X    if ((err = unix_stat(pathstr(dpdir), &stb)) != noErr)
X      return(err);
X    mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
X!   err = os_copy(spath,dpath, mo);
X  
X    if (err != noErr && DBOSI)
X      printf("OSCopyFile: DATA copy failed %s\n",afperr(err));
X
X--- 2291,2297 -----
X    if ((err = unix_stat(pathstr(dpdir), &stb)) != noErr)
X      return(err);
X    mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
X!   err = os_copy(s_path,d_path, mo);
X  
X    if (err != noErr && DBOSI)
X      printf("OSCopyFile: DATA copy failed %s\n",afperr(err));
X***************
X*** 2092,2099
X    if (err != noErr)
X      return(err);
X  
X!   OSfname(spath,spdir,sfile,F_RSRC);	/* create unix style name for rsrc */
X!   OSfname(dpath,dpdir,dfile,F_RSRC);	/*  same for destination */
X    err = os_copy(spath,dpath,mo); /* do the copy... */
X    /* allow object not found */
X    if (err != noErr && err != aeObjectNotFound) { /* if failure.... */
X
X--- 2299,2308 -----
X    if (err != noErr)
X      return(err);
X  
X!   strcpy(spath,s_path);
X!   toResFork(spath,sfile);		/* create unix style name for rsrc */
X!   strcpy(dpath,d_path);
X!   toResFork(dpath,dfile);		/*  same for destination */
X    err = os_copy(spath,dpath,mo); /* do the copy... */
X    /* allow object not found */
X    if (err != noErr && err != aeObjectNotFound) { /* if failure.... */
X***************
X*** 2103,2110
X      return(err);
X    }
X  
X!   OSfname(spath,spdir,sfile,F_FNDR);	/* create unix style name for fndr */
X!   OSfname(dpath,dpdir,dfile,F_FNDR);	/*  same for destination */
X    err = os_copy(spath,dpath,mo); /* do the copy... */
X    /* allow object not found */
X    if (err != noErr && err != aeObjectNotFound) {
X
X--- 2312,2321 -----
X      return(err);
X    }
X  
X!   strcpy(spath,s_path);
X!   toFinderInfo(spath,sfile);		/* create unix style name for fndr */
X!   strcpy(dpath,d_path);
X!   toFinderInfo(dpath,dfile);		/*  same for destination */
X    err = os_copy(spath,dpath,mo); /* do the copy... */
X    /* allow object not found */
X    if (err != noErr && err != aeObjectNotFound) {
X***************
X*** 2210,2215
X  char *file;
X  int delf;			/* if want to delete existing file */
X  {
X    char path[MAXPATHLEN];
X    int err,derr,rerr,cerr,mo;
X    struct stat stb;
X
X--- 2421,2427 -----
X  char *file;
X  int delf;			/* if want to delete existing file */
X  {
X+   char p_ath[MAXPATHLEN];
X    char path[MAXPATHLEN];
X    int err,derr,rerr,cerr,mo;
X    struct stat stb;
X***************
X*** 2214,2220
X    int err,derr,rerr,cerr,mo;
X    struct stat stb;
X  
X!   OSfname(path,pdir,file,F_DATA);	/* create data file name */
X  
X    if (DBOSI)
X      printf("OSCreateFile: creating %s with %s\n",path,
X
X--- 2426,2435 -----
X    int err,derr,rerr,cerr,mo;
X    struct stat stb;
X  
X!   OSfname(p_ath,pdir,file,F_DATA);	/* create data file name */
X! #ifdef NOCASEMATCH
X!   noCaseMatch(p_ath);
X! #endif NOCASEMATCH
X  
X    if (DBOSI)
X      printf("OSCreateFile: creating %s with %s\n",p_ath,
X***************
X*** 2217,2223
X    OSfname(path,pdir,file,F_DATA);	/* create data file name */
X  
X    if (DBOSI)
X!     printf("OSCreateFile: creating %s with %s\n",path,
X  	   (delf) ? "OverWrite" : "No OverWrite");
X    
X    err = unix_stat(pathstr(pdir),&stb);
X
X--- 2432,2438 -----
X  #endif NOCASEMATCH
X  
X    if (DBOSI)
X!     printf("OSCreateFile: creating %s with %s\n",p_ath,
X  	   (delf) ? "OverWrite" : "No OverWrite");
X    
X    err = unix_stat(pathstr(pdir),&stb);
X***************
X*** 2226,2233
X    mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
X  
X    /* should never get aeObjectExists if delf was true */
X!   OSfname(path,pdir,file,F_DATA);	/* create data fork */
X!   derr = unix_create(path,delf,mo);	/* using user delete flag */
X    if (derr != noErr && derr != aeObjectExists) {
X      if (DBOSI)
X        printf("OSCreateFile: DATA fork create failed\n");
X
X--- 2441,2447 -----
X    mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
X  
X    /* should never get aeObjectExists if delf was true */
X!   derr = unix_create(p_ath,delf,mo);	/* using user delete flag */
X    if (derr != noErr && derr != aeObjectExists) {
X      if (DBOSI)
X        printf("OSCreateFile: DATA fork create failed\n");
X***************
X*** 2233,2240
X        printf("OSCreateFile: DATA fork create failed\n");
X      /* previously under a conditional on delf, but not necessary */
X      /* anymore because we don't get here if the object was already there */
X!     OSfname(path,pdir,file,F_DATA);
X!     cerr = unix_unlink(path);		/* clean up... */
X      if (cerr != noErr && DBOSI)
X        printf("OSCreateFile: cleanup failed\n");
X      return(derr);
X
X--- 2447,2453 -----
X        printf("OSCreateFile: DATA fork create failed\n");
X      /* previously under a conditional on delf, but not necessary */
X      /* anymore because we don't get here if the object was already there */
X!     cerr = unix_unlink(p_ath);		/* clean up... */
X      if (cerr != noErr && DBOSI)
X        printf("OSCreateFile: cleanup failed\n");
X      return(derr);
X***************
X*** 2240,2246
X      return(derr);
X    }
X  
X!   OSfname(path,pdir,file,F_RSRC);	/* try creating resource fork */
X    rerr = unix_create(path,delf,mo);	/* ... */
X    if (rerr != noErr && rerr != aeObjectExists && rerr != aeObjectNotFound) {
X      if (DBOSI)
X
X--- 2453,2460 -----
X      return(derr);
X    }
X  
X!   strcpy(path,p_ath);
X!   toResFork(path,file);			/* try creating resource fork */
X    rerr = unix_create(path,delf,mo);	/* ... */
X    if (rerr != noErr && rerr != aeObjectExists && rerr != aeObjectNotFound) {
X      if (DBOSI)
X***************
X*** 2247,2253
X        printf("OSCreateFile: RSRC create failed\n");
X      /* previously under a conditional on delf, but not necessary */
X      /* anymore because we don't get here if the object was already there */
X-     OSfname(path,pdir,file,F_RSRC);
X      cerr = unix_unlink(path);		/* clean up... */
X      if (cerr != noErr && DBOSI)
X        printf("OSCreateFile: cleanup failed\n");
X
X--- 2461,2466 -----
X        printf("OSCreateFile: RSRC create failed\n");
X      /* previously under a conditional on delf, but not necessary */
X      /* anymore because we don't get here if the object was already there */
X      cerr = unix_unlink(path);		/* clean up... */
X      if (cerr != noErr && DBOSI)
X        printf("OSCreateFile: cleanup failed\n");
X***************
X*** 2255,2261
X      return(rerr);
X    }
X  
X!   OSfname(path,pdir,file,F_FNDR);	/* create finder fork */
X    err = unix_create(path,TRUE,mo);
X    /* ignore error here - exactly what should be done? */
X  
X
X--- 2468,2475 -----
X      return(rerr);
X    }
X  
X!   strcpy(path,p_ath);
X!   toFinderInfo(path,file);		/* create finder fork */
X    err = unix_create(path,TRUE,mo);
X    /* ignore error here - exactly what should be done? */
X  
X***************
X*** 2277,2282
X    char path[MAXPATHLEN];
X    char *ms;
X    int mo;
X  
X    OSfname(path,pdir,file,typ);		/* expand name */
X  
X
X--- 2491,2499 -----
X    char path[MAXPATHLEN];
X    char *ms;
X    int mo;
X+ #ifdef NOCASEMATCH
X+   register int i;
X+ #endif NOCASEMATCH
X  
X    OSfname(path,pdir,file,typ);		/* expand name */
X  
X***************
X*** 2298,2303
X    if (DBOSI) 
X      printf("OSOpenFork: Opening %s for %s\n",path,ms);
X  
X    return(unix_open(path,mo,fhdl));
X  }
X  
X
X--- 2515,2527 -----
X    if (DBOSI) 
X      printf("OSOpenFork: Opening %s for %s\n",path,ms);
X  
X+ #ifdef NOCASEMATCH
X+   if((i = unix_open(path,mo,fhdl)) != noErr) {
X+     noCaseFind(path);
X+     i = unix_open(path,mo,fhdl);
X+   }
X+   return(i);
X+ #else NOCASEMATCH
X    return(unix_open(path,mo,fhdl));
X  #endif NOCASEMATCH
X  }
X***************
X*** 2299,2304
X      printf("OSOpenFork: Opening %s for %s\n",path,ms);
X  
X    return(unix_open(path,mo,fhdl));
X  }
X  
X  
X
X--- 2523,2529 -----
X    return(i);
X  #else NOCASEMATCH
X    return(unix_open(path,mo,fhdl));
X+ #endif NOCASEMATCH
X  }
X  
X  
SHAR_EOF
if test 41043 -ne "`wc -c < 'afpos.c.diff'`"
then
	echo shar: error transmitting "'afpos.c.diff'" '(should have been 41043 characters)'
fi
fi # end of overwriting check
#	End of shell archive
exit 0
--- end of part 2 ---
Technical Details
Message-ID: <23464@dhw68k.cts.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!oliveb!felix!dhw68k!macintosh
References: <23435@dhw68k.cts.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!oliveb!felix!dhw68k!macintosh
From: edmoy@violet.berkeley.edu (Edward Moy)
Newsgroups: comp.sources.mac
Subject: New Patches to CAP (part 2 of 2)
Message-ID: <23464@dhw68k.cts.com>
Date: 4 Jun 89 17:01:51 GMT
References: <23435@dhw68k.cts.com>
Sender: macintosh@dhw68k.cts.com
Lines: 1593
Approved: Info-Mac@sumex-aim.stanford.edu