This is unixfsys.c in view mode; [Download] [Up]
Changes file for /usr/local/src/kcl/c/unixfsys.c Created on Fri Mar 29 18:08:34 1991 Usage \n@s[Original text\n@s|Replacement Text\n@s] See the file rascal.ics.utexas.edu:/usr2/ftp/merge.c for a program to merge change files. Anything not between "\n@s[" and "\n@s]" is a simply a comment. This file was constructed using emacs and merge.el Enhancements Copyright (c) W. Schelter All rights reserved. by (Bill Schelter) wfs@carl.ma.utexas.edu ****Change:(orig (6 6 a)) @s[proper "License Agreement for Kyoto Common LISP" with SIGLISP. */ @s|proper "License Agreement for Kyoto Common LISP" with SIGLISP. */ #define IN_UNIXFSYS @s] ****Change:(orig (15 15 d)) @s[#define MAXPATHLEN 1024 object Kwild; @s|#define MAXPATHLEN 1024 @s] ****Change:(orig (17 18 c)) @s[ #ifdef ATT @s| #ifdef NEED_GETWD @s] ****Change:(orig (20 20 d)) @s[#include <sys/dir.h> #include <mnttab.h> @s|#include <sys/dir.h> @s] ****Change:(orig (22 22 d)) @s[char dotdot[3*16+2] = "../../../../../../../../../../../../../../../../."; @s| @s] ****Change:(orig (23 23 a)) @s[ @s| #ifndef GETCWD char dotdot[3*16+2] = "../../../../../../../../../../../../../../../../."; #include <mnttab.h> @s] ****Change:(orig (110 110 a)) @s[ /* END OF BUG FIX */ getwd_bufp = i; } @s| /* END OF BUG FIX */ getwd_bufp = i; } #endif /* not GETCWD */ @s] ****Change:(orig (113 113 c)) @s[#endif #ifdef E15 @s|#endif #ifdef GETCWD @s] ****Change:(orig (183 193 c)) @s[ int i; object namestring; namestring = coerce_to_namestring(pathname); @s, p[i] = namestring->st.st_self[i]; p[i] = '\0'; @s| int n; object namestring; namestring = coerce_to_namestring(pathname); if(namestring->st.st_self[0]=='~') {char name[20]; int j; object ans; char *q = namestring->st.st_self; extern struct passwd *getpwuid(); extern struct passwd *getpwnam(); char filename[MAXPATHLEN]; struct passwd *pwent; int m; q=namestring->st.st_self; for (n=0; n< namestring->st.st_fillp; n++) if (q[n]=='/') break; bcopy(q+1,name,n-1); name[n-1]= 0; pwent = (n==1 ? getpwuid(getpwuid(getuid())) : getpwnam(name)); if (pwent==0 || ((m = strlen(pwent->pw_dir)) && (m + namestring->st.st_fillp -n) >= MAXPATHLEN -16)) {FEerror("Can't expand pathname ~a", 1,namestring);} bcopy(pwent->pw_dir,p,m); bcopy(namestring->st.st_self+n,p+m,namestring->st.st_fillp-n); p[m+namestring->st.st_fillp-n]=0;} else {if (namestring->st.st_fillp >= MAXPATHLEN - 16) { vs_push(namestring); FEerror("Too long filename: ~S.", 1, namestring);} bcopy(namestring->st.st_self,p,namestring->st.st_fillp); p[namestring->st.st_fillp]=0;} @s] ****Change:(orig (259 259 c)) @s[ if (stat(filename, &filestatus) >= 0) return(TRUE); @s| if (stat(filename, &filestatus) >= 0) { #ifdef AIX /* if /tmp/foo is not a directory /tmp/foo/ should not exist */ if (filename[strlen(filename)-1] == '/' && !( filestatus.st_mode & S_IFDIR)) return(FALSE); #endif return TRUE; } @s] ****Change:(orig (265 265 a)) @s[backup_fopen(filename, option) @s|backup_fopen(filename, option) char *filename,*option; @s] ****Change:(orig (306 306 a)) @s[ coerce_to_filename(vs_base[1], newfilename); @s| coerce_to_filename(vs_base[1], newfilename); #ifdef BSD if (rename(filename, newfilename) < 0) FEerror("Cannot rename the file ~S to ~S.", 2, vs_base[0], vs_base[1]); #else @s] ****Change:(orig (308 308 a)) @s[ sprintf(command, "mv %s %s", filename, newfilename); system(command); @s| sprintf(command, "mv %s %s", filename, newfilename); system(command); #endif @s]
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.