.
authorclaus
Thu, 07 Sep 1995 13:59:50 +0200
changeset 422 63600ce8c7cc
parent 421 a0807a38319d
child 423 7a4bfd3cc267
.
Boolean.st
ByteArray.st
ExtStream.st
ExternalStream.st
Filename.st
SeqColl.st
SequenceableCollection.st
String.st
Unix.st
--- a/Boolean.st	Sun Sep 03 17:06:58 1995 +0200
+++ b/Boolean.st	Thu Sep 07 13:59:50 1995 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1988 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Boolean.st,v 1.13 1995-08-11 02:59:02 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Boolean.st,v 1.14 1995-09-07 11:57:49 claus Exp $
 '!
 
 !Boolean class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Boolean.st,v 1.13 1995-08-11 02:59:02 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Boolean.st,v 1.14 1995-09-07 11:57:49 claus Exp $
 "
 !
 
@@ -79,6 +79,16 @@
     ^ true
 ! !
 
+!Boolean methodsFor:'converting'!
+
+literalArrayEncoding
+    "encode myself as an array literal."
+
+    ^ self
+
+    "Modified: 5.9.1995 / 22:46:57 / claus"
+! !
+
 !Boolean methodsFor:'copying'!
 
 copy
--- a/ByteArray.st	Sun Sep 03 17:06:58 1995 +0200
+++ b/ByteArray.st	Thu Sep 07 13:59:50 1995 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.32 1995-08-16 12:48:06 claus Exp $
+$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.33 1995-09-07 11:57:52 claus Exp $
 '!
 
 !ByteArray class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.32 1995-08-16 12:48:06 claus Exp $
+$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.33 1995-09-07 11:57:52 claus Exp $
 "
 !
 
@@ -1508,7 +1508,7 @@
 	}
 
 	value = _intVal(aNumber);
-	if ((value >= 0) && (value <= 255)
+	if (((value & ~0xFF) == 0) /* i.e. (value >= 0) && (value <= 255) */
 	 && (index1 <= index2) 
 	 && (index1 > 0)) {
 	    if (index2 <= len) {
@@ -1516,6 +1516,14 @@
 #ifdef FAST_MEMSET
 		memset(dstp, count, value);
 #else
+# ifdef UNROLL_LOOPS
+		while (count >= 8) {
+		    dstp[0] = dstp[1] = dstp[2] = dstp[3] =
+		    dstp[4] = dstp[5] = dstp[6] = dstp[7] = value;
+		    dstp += 8;
+		    count -= 8;
+		}
+# endif
 		while (count--) {
 		    *dstp++ = value;
 		}
--- a/ExtStream.st	Sun Sep 03 17:06:58 1995 +0200
+++ b/ExtStream.st	Thu Sep 07 13:59:50 1995 +0200
@@ -24,7 +24,7 @@
 COPYRIGHT (c) 1988 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Attic/ExtStream.st,v 1.48 1995-09-03 15:04:57 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/ExtStream.st,v 1.49 1995-09-07 11:58:15 claus Exp $
 '!
 
 !ExternalStream primitiveDefinitions!
@@ -86,7 +86,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Attic/ExtStream.st,v 1.48 1995-09-03 15:04:57 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/ExtStream.st,v 1.49 1995-09-07 11:58:15 claus Exp $
 "
 !
 
@@ -1888,7 +1888,7 @@
 		if (_INST(buffered) == false) {
 		    do {
 			cnt = write(fileno(f), cp, len);
-		        if (cnt != len) {
+			if (cnt != len) {
 			    if (cnt >= 0) {
 				if (errno == EINTR) {
 				    cp += cnt;
@@ -2681,7 +2681,7 @@
 
 	f = MKFD(fp);
 	__READING__(f)
-
+	errno = 0;
 	__BEGIN_INTERRUPTABLE__
 	do {
 	    c = getc(f);
@@ -2983,6 +2983,7 @@
 	    while (1) {
 		if (feof(f)) {
 		    __END_INTERRUPTABLE__
+		    _INST(hitEOF) = true;
 		    RETURN ( nil );
 		}
 
@@ -3047,6 +3048,7 @@
                 
 		if (feof(f)) {
 		    __END_INTERRUPTABLE__
+		    _INST(hitEOF) = true;
 		    RETURN ( nil );
 		}
 
@@ -3225,11 +3227,12 @@
     
     __READING__(f)
 
-/*
+#ifdef SYSV
     if (feof(f)) {
+	_INST(hitEOF) = true;
 	RETURN (nil);
     }
-*/
+#endif
     /*
      * skip spaces
      */
--- a/ExternalStream.st	Sun Sep 03 17:06:58 1995 +0200
+++ b/ExternalStream.st	Thu Sep 07 13:59:50 1995 +0200
@@ -24,7 +24,7 @@
 COPYRIGHT (c) 1988 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.48 1995-09-03 15:04:57 claus Exp $
+$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.49 1995-09-07 11:58:15 claus Exp $
 '!
 
 !ExternalStream primitiveDefinitions!
@@ -86,7 +86,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.48 1995-09-03 15:04:57 claus Exp $
+$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.49 1995-09-07 11:58:15 claus Exp $
 "
 !
 
@@ -1888,7 +1888,7 @@
 		if (_INST(buffered) == false) {
 		    do {
 			cnt = write(fileno(f), cp, len);
-		        if (cnt != len) {
+			if (cnt != len) {
 			    if (cnt >= 0) {
 				if (errno == EINTR) {
 				    cp += cnt;
@@ -2681,7 +2681,7 @@
 
 	f = MKFD(fp);
 	__READING__(f)
-
+	errno = 0;
 	__BEGIN_INTERRUPTABLE__
 	do {
 	    c = getc(f);
@@ -2983,6 +2983,7 @@
 	    while (1) {
 		if (feof(f)) {
 		    __END_INTERRUPTABLE__
+		    _INST(hitEOF) = true;
 		    RETURN ( nil );
 		}
 
@@ -3047,6 +3048,7 @@
                 
 		if (feof(f)) {
 		    __END_INTERRUPTABLE__
+		    _INST(hitEOF) = true;
 		    RETURN ( nil );
 		}
 
@@ -3225,11 +3227,12 @@
     
     __READING__(f)
 
-/*
+#ifdef SYSV
     if (feof(f)) {
+	_INST(hitEOF) = true;
 	RETURN (nil);
     }
-*/
+#endif
     /*
      * skip spaces
      */
--- a/Filename.st	Sun Sep 03 17:06:58 1995 +0200
+++ b/Filename.st	Thu Sep 07 13:59:50 1995 +0200
@@ -20,7 +20,7 @@
 COPYRIGHT (c) 1992 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.31 1995-08-11 03:00:44 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.32 1995-09-07 11:58:28 claus Exp $
 '!
 
 !Filename class methodsFor:'documentation'!
@@ -41,7 +41,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.31 1995-08-11 03:00:44 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.32 1995-09-07 11:58:28 claus Exp $
 "
 !
 
@@ -234,23 +234,30 @@
      unix process id, and nn is a unique number, incremented with every
      call to this method."
 
-    |pid nm|
+    |pid tempDir nm|
 
     NextTempFilenameIndex isNil ifTrue:[
 	NextTempFilenameIndex := 1.
     ].
+    tempDir := OperatingSystem getEnvironment:'TMPDIR'.
+    tempDir isNil ifTrue:[
+	tempDir := '/tmp'
+    ].
+
     "
      the following has to be made OS independent ...
     "
     pid := OperatingSystem getProcessId printString.
-    nm := '/tmp/stxtmp_' , pid , '_' , NextTempFilenameIndex printString.
+    nm := tempDir , '/stxtmp_' , pid , '_' , NextTempFilenameIndex printString.
     NextTempFilenameIndex := NextTempFilenameIndex + 1.
     ^ self named:nm
 
     "
-     Filename newTemporary
-     Filename newTemporary
+     Filename newTemporary    
+     Filename newTemporary  
     "
+
+    "Modified: 7.9.1995 / 10:48:31 / claus"
 !
 
 fromUser
@@ -282,6 +289,20 @@
      "
 !
 
+suffixSeparator
+    "return the filename suffix separator.
+     Usually, this is $. for unix-like and msdos systems 
+     (there is currently no knowns system, where this differs)"
+
+     ^ $.
+
+     "
+      Filename suffixSeparator  
+     "
+
+    "Modified: 7.9.1995 / 11:10:43 / claus"
+!
+
 parentDirectoryName 
     "return the name used for the parent directory.
      This is '..' for unix and dos-like systems. 
@@ -303,8 +324,8 @@
 
 defaultClass
     "ST-80 compatibility:
-     in ST-80, different subclasses of FIlename are used for different
-     OperatingSYstems; defaultClass is supposed to return an appropriate class.
+     in ST-80, different subclasses of Filename are used for different
+     OperatingSystems; defaultClass is supposed to return an appropriate class.
      Since in ST/X, there is (currently) only one Filename class, return it here."
 
     ^ self
@@ -312,19 +333,25 @@
 
 localNameStringFrom:aString
     "ST-80 compatibility.
-     what does this do ? (used in FileNavigator-goody)"
+     what does this do ? (used in FileNavigator-goody).
+     GUESS: does it strip off the voulume-character on MSDOS systems ?"
 
     (aString startsWith:'/') ifTrue:[
 	^ aString copyFrom:2
     ].
     ^ aString
+
+    "Modified: 7.9.1995 / 10:44:56 / claus"
 !
 
 volumes
     "ST-80 compatibility.
-     what does this do ? (used in FileNavigator-goody)"
+     what does this do ? (used in FileNavigator-goody).
+     GUESS: does it return the available drives on MSDOS systems ?"
 
     ^ #('/')
+
+    "Modified: 7.9.1995 / 10:45:25 / claus"
 ! !
 
 !Filename methodsFor:'instance creation'!
@@ -341,7 +368,7 @@
 	"I am the root"
 	^ sepString  , subname
     ].
-    ^ nameString , sepString , subname
+    ^ nameString , sepString , subname asString
 
     "
      '/tmp' asFilename constructString:'foo'   
@@ -349,6 +376,8 @@
      '/usr/tmp' asFilename constructString:'foo'
      '/foo/bar' asFilename constructString:'baz' 
     "
+
+    "Modified: 7.9.1995 / 10:15:22 / claus"
 !
 
 construct:subname
@@ -464,24 +493,49 @@
     ^ self class separator
 !
 
+directoryPathName
+    "return the full directory pathname part of the file/directory as a string.
+     - thats the full pathname of the directory where the file/dir represented by
+       the receiver is contained in.
+     See also: directoryName"
+
+    ^ OperatingSystem directoryNameOf:(self pathName)
+
+    "
+     '/foo/bar/' asFilename directoryPathName    
+     '/foo/bar' asFilename directoryPathName    
+     '.' asFilename directoryPathName        
+     '..' asFilename directoryPathName       
+     '../..' asFilename directoryPathName     
+    "
+
+    "Modified: 7.9.1995 / 10:42:13 / claus"
+!
+
 directoryName
-    "return the directory name part of the file/directory.
+    "return the directory name part of the file/directory as a string.
      - thats the name of the directory where the file/dir represented by
-       the receiver is contained in."
+       the receiver is contained in.
+     See also: #directoryPathName"
 
     ^ OperatingSystem directoryNameOf:nameString "/ (self pathName)
 
     "
      '/foo/bar/' asFilename directoryName    
      '/foo/bar' asFilename directoryName    
+     'bitmaps' asFilename directoryName        
+     'bitmaps' asFilename directoryPathName        
      '.' asFilename directoryName        
      '..' asFilename directoryName       
      '../..' asFilename directoryName     
+     '../..' asFilename directoryPathName     
     "
+
+    "Modified: 7.9.1995 / 10:42:03 / claus"
 !
 
 directory
-    "return the directory name part of the file/directory.
+    "return the directory name part of the file/directory as a filename.
      - thats a filename for the directory where the file/dir represented by
        the receiver is contained in."
 
@@ -506,13 +560,14 @@
 !
 
 tail
-    "the files name without directory prefix. For ST-80 compatiblity."
+    "the files name without directory prefix as a string. 
+     An alias for baseName, for ST-80 compatiblity."
 
     ^ self baseName
 !
 
 baseName
-    "return my baseName
+    "return my baseName as a string.
      - thats the file/directory name without leading parent-dirs."
 
     ^ OperatingSystem baseNameOf:nameString "/ (self pathName) 
@@ -524,11 +579,37 @@
      '../..' asFilename baseName        
      '../../libbasic' asFilename baseName        
      '../../libpr' asFilename baseName        
+     '../../libbasic/Object.st' asFilename baseName        
     "
 !
 
+name
+    "return the name of the file represented by the receiver as a string.
+     This may or may not be a relative name.
+     See also: pathName"
+
+    self isAbsolute ifTrue:[^ self pathName].
+    ^ nameString
+
+    "
+     '/foo/bar' asFilename name        
+     '/foo/bar' asFilename pathName    
+     '.' asFilename name                
+     '.' asFilename pathName             
+     '../..' asFilename name             
+     '../..' asFilename pathName         
+     'bitmaps' asFilename name                
+     'bitmaps' asFilename pathName             
+     '/tmp/../usr' asFilename name       
+     '/tmp/../usr' asFilename pathName   
+    "
+
+    "Modified: 7.9.1995 / 10:41:14 / claus"
+!
+
 pathName
-    "return the full pathname of the file represented by the receiver."
+    "return the full pathname of the file represented by the receiver,
+     as a string. See also: name"
 
     |parentName sep|
 
@@ -545,8 +626,11 @@
      '/foo/bar' asFilename pathName
      '.' asFilename pathName 
      '../..' asFilename pathName 
+     '../..' asFilename name 
      '/tmp/../usr' asFilename pathName  
     "
+
+    "Modified: 7.9.1995 / 10:42:39 / claus"
 !
 
 isAbsolute
@@ -674,6 +758,56 @@
     "
 !
 
+prefixAndSuffix
+    "return an array consisting of my prefix and suffix.
+     The suffix is the namepart after the final period character,
+     the prefix everything before, except for the period.
+     (on some systems, the suffix-character may be different from a period).
+     For example, foo.bar.baz has a prefix of 'foo.bar' and a suffix of '.baz'.
+
+     Notice: there is currently no known system which uses other than
+     the period character as suffixCharacter."
+
+    |nm idx|
+
+    nm := self baseName.
+    idx := nm lastIndexOf:(self class suffixSeparator).
+    idx == 0 ifTrue:[
+	^ Array with:nm with:''
+    ].
+    ^ Array 
+	with:(nm copyTo:idx-1)
+	with:(nm copyFrom:idx+1)
+
+    "
+     'abc.st' asFilename prefixAndSuffix  
+     'abc' asFilename prefixAndSuffix  
+     'a.b.c' asFilename prefixAndSuffix 
+
+     |parts| 
+     parts := 'Object.st' asFilename prefixAndSuffix.
+     ((parts at:1) , '.o') asFilename
+    "
+
+    "Modified: 7.9.1995 / 11:15:42 / claus"
+!
+
+suffix
+    "return my suffix.
+     The suffix is the namepart after the final period character,
+     or the empty string, if the name does not contain a period."
+
+    ^ self prefixAndSuffix at:2
+
+    "
+     'abc.st' asFilename suffix   
+     'abc' asFilename suffix      
+     'a.b.c' asFilename suffix    
+    "
+
+    "Modified: 7.9.1995 / 11:09:03 / claus"
+!
+
 filesMatching:aPattern
     ^ self directoryContents select:[:name | aPattern match:name]
 
--- a/SeqColl.st	Sun Sep 03 17:06:58 1995 +0200
+++ b/SeqColl.st	Thu Sep 07 13:59:50 1995 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Attic/SeqColl.st,v 1.36 1995-08-11 03:03:32 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/SeqColl.st,v 1.37 1995-09-07 11:59:15 claus Exp $
 '!
 
 !SequenceableCollection class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Attic/SeqColl.st,v 1.36 1995-08-11 03:03:32 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/SeqColl.st,v 1.37 1995-09-07 11:59:15 claus Exp $
 "
 !
 
@@ -382,6 +382,16 @@
      #(Point 10 20) decodeAsLiteralArray  
      #(Rectangle 100 200 400 500) decodeAsLiteralArray 
     "
+!
+
+literalArrayEncoding
+    ^ (self collect:[:el | el literalArrayEncoding]) asArray
+
+    "
+     (Array with:(Color red:50 green:50 blue:50)
+	    with:(1 @ 2)
+     ) literalArrayEncoding   
+    "
 ! !
 
 !SequenceableCollection methodsFor:'comparing'!
--- a/SequenceableCollection.st	Sun Sep 03 17:06:58 1995 +0200
+++ b/SequenceableCollection.st	Thu Sep 07 13:59:50 1995 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.36 1995-08-11 03:03:32 claus Exp $
+$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.37 1995-09-07 11:59:15 claus Exp $
 '!
 
 !SequenceableCollection class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.36 1995-08-11 03:03:32 claus Exp $
+$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.37 1995-09-07 11:59:15 claus Exp $
 "
 !
 
@@ -382,6 +382,16 @@
      #(Point 10 20) decodeAsLiteralArray  
      #(Rectangle 100 200 400 500) decodeAsLiteralArray 
     "
+!
+
+literalArrayEncoding
+    ^ (self collect:[:el | el literalArrayEncoding]) asArray
+
+    "
+     (Array with:(Color red:50 green:50 blue:50)
+	    with:(1 @ 2)
+     ) literalArrayEncoding   
+    "
 ! !
 
 !SequenceableCollection methodsFor:'comparing'!
--- a/String.st	Sun Sep 03 17:06:58 1995 +0200
+++ b/String.st	Thu Sep 07 13:59:50 1995 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1988 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/String.st,v 1.44 1995-09-03 15:06:40 claus Exp $
+$Header: /cvs/stx/stx/libbasic/String.st,v 1.45 1995-09-07 11:59:35 claus Exp $
 '!
 
 !String class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/String.st,v 1.44 1995-09-03 15:06:40 claus Exp $
+$Header: /cvs/stx/stx/libbasic/String.st,v 1.45 1995-09-07 11:59:35 claus Exp $
 "
 !
 
@@ -372,8 +372,12 @@
     if (__isString(self)) {
 	if (__isCharacter(aCharacter)) {
 	    value = _intVal(_characterVal(aCharacter));
+#ifdef OLD
 	    if ((value > 0) 
 	     && (value <= 255)
+#else
+	    if (((value & ~0xFF) == 0)
+#endif
 	     && __isSmallInteger(index)) {
 		indx = _intVal(index);
 		if (indx > 0) {
--- a/Unix.st	Sun Sep 03 17:06:58 1995 +0200
+++ b/Unix.st	Thu Sep 07 13:59:50 1995 +0200
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1988 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Attic/Unix.st,v 1.50 1995-08-27 14:27:01 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/Unix.st,v 1.51 1995-09-07 11:59:50 claus Exp $
 '!
 
 !OperatingSystem primitiveFunctions!
@@ -304,7 +304,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Attic/Unix.st,v 1.50 1995-08-27 14:27:01 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/Unix.st,v 1.51 1995-09-07 11:59:50 claus Exp $
 "
 !
 
@@ -3690,9 +3690,15 @@
     int ret;
 
     if (__isString(aPathName) || __isSymbol(aPathName) ) {
+	__BEGIN_INTERRUPTABLE__
 	do {
 	    ret = stat((char *) _stringVal(aPathName), &buf);
-	} while (ret < 0 && errno == EINTR);
+	} while ((ret < 0) && (errno == EINTR));
+	__END_INTERRUPTABLE__
+	if (ret < 0) {
+	    OperatingSystem_LastErrorNumber = _MKSMALLINT(errno);
+	    RETURN (false);
+	}
 	RETURN ( ret ? false : true );
     }
 %}
@@ -3710,14 +3716,16 @@
     int ret;
 
     if (__isString(aPathName)) {
+	__BEGIN_INTERRUPTABLE__
 	do {
 	    ret = stat((char *) _stringVal(aPathName), &buf);
-	} while (ret < 0 && errno == EINTR);
-	if ((ret < 0) || ((buf.st_mode & S_IFMT) != S_IFDIR)) {
+	} while ((ret < 0) && (errno == EINTR));
+	__END_INTERRUPTABLE__
+	if (ret < 0) {
 	    OperatingSystem_LastErrorNumber = _MKSMALLINT(errno);
 	    RETURN ( false );
 	}
-	RETURN ( true );
+	RETURN ( ((buf.st_mode & S_IFMT) == S_IFDIR) ? true : false);
     }
 %}.
     self primitiveFailed
@@ -3731,16 +3739,20 @@
     "return true, if the file/dir 'aPathName' is readable."
 
 %{  /* NOCONTEXT */
+    int ret;
 
     if (__isString(aPathName)) {
-	if (access(_stringVal(aPathName), R_OK) == 0) {
-	    RETURN ( true );
+	__BEGIN_INTERRUPTABLE__
+	do {
+	    ret = access(_stringVal(aPathName), R_OK);
+	} while ((ret < 0) && (errno == EINTR));
+	__END_INTERRUPTABLE__
+	if (ret < 0) {
+	    OperatingSystem_LastErrorNumber = _MKSMALLINT(errno);
 	}
-	OperatingSystem_LastErrorNumber = _MKSMALLINT(errno);
-	RETURN ( false );
+	return ((ret == 0) ? true : false);
     }
-%}
-.
+%}.
     self primitiveFailed
 !
 
@@ -3748,16 +3760,20 @@
     "return true, if the given file is writable"
 
 %{  /* NOCONTEXT */
+    int ret;
 
     if (__isString(aPathName)) {
-	if (access(_stringVal(aPathName), W_OK) == 0) {
-	    RETURN ( true );
-	}
-	OperatingSystem_LastErrorNumber = _MKSMALLINT(errno);
-	RETURN ( false );
+	__BEGIN_INTERRUPTABLE__
+        do {
+            ret = access(_stringVal(aPathName), W_OK);
+        } while ((ret < 0) && (errno == EINTR));
+        __END_INTERRUPTABLE__
+        if (ret < 0) {
+            OperatingSystem_LastErrorNumber = _MKSMALLINT(errno);
+        }
+        return ((ret == 0) ? true : false);
     }
-%}
-.
+%}.
     self primitiveFailed
 !
 
@@ -3765,16 +3781,20 @@
     "return true, if the given file is executable"
 
 %{  /* NOCONTEXT */
+    int ret;
 
     if (__isString(aPathName)) {
-	if (access(_stringVal(aPathName), X_OK) == 0) {
-	    RETURN ( true );
-	}
-	OperatingSystem_LastErrorNumber = _MKSMALLINT(errno);
-	RETURN ( false );
+        __BEGIN_INTERRUPTABLE__
+        do {
+            ret = access(_stringVal(aPathName), X_OK);
+        } while ((ret < 0) && (errno == EINTR));
+        __END_INTERRUPTABLE__
+        if (ret < 0) {
+            OperatingSystem_LastErrorNumber = _MKSMALLINT(errno);
+        }
+        return ((ret == 0) ? true : false);
     }
-%}
-.
+%}.
     self primitiveFailed
 !
 
@@ -3805,9 +3825,12 @@
     char pathBuffer[1024];
 
     if (__isString(aPathName)) {
+	__BEGIN_INTERRUPTABLE__
 	do {
 	    ret = lstat((char *) _stringVal(aPathName), &buf);
-	} while (ret < 0 && errno == EINTR);
+	} while ((ret < 0) && (errno == EINTR));
+	__END_INTERRUPTABLE__
+
 	if (ret < 0) {
 	    OperatingSystem_LastErrorNumber = _MKSMALLINT(errno);
 	    RETURN ( nil );
@@ -3877,9 +3900,12 @@
     int ret;
 
     if (__isString(aPathName)) {
+	__BEGIN_INTERRUPTABLE__
 	do {
 	    ret = stat((char *) _stringVal(aPathName), &buf);
-	} while (ret < 0 && errno == EINTR);
+	} while ((ret < 0) && (errno == EINTR));
+	__END_INTERRUPTABLE__
+
 	if (ret < 0) {
 	    OperatingSystem_LastErrorNumber = _MKSMALLINT(errno);
 	    RETURN ( nil );
@@ -4026,9 +4052,12 @@
     int ret;
 
     if (__isString(aPathName)) {
+	__BEGIN_INTERRUPTABLE__
 	do {
 	    ret = stat((char *) _stringVal(aPathName), &buf);
-	} while (ret < 0 && errno == EINTR);
+	} while ((ret < 0) && (errno == EINTR));
+	__END_INTERRUPTABLE__
+
 	if (ret < 0) {
 	    OperatingSystem_LastErrorNumber = _MKSMALLINT(errno);
 	    RETURN ( nil );