*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Fri, 23 Jun 2000 20:54:30 +0200
changeset 5409 9b5890348f9c
parent 5408 5287fd5f6ab0
child 5410 859c010edb47
*** empty log message ***
OSFileHandle.st
OSHandle.st
UnixFileDescriptorHandle.st
UnixFileHandle.st
--- a/OSFileHandle.st	Fri Jun 23 20:48:24 2000 +0200
+++ b/OSFileHandle.st	Fri Jun 23 20:54:30 2000 +0200
@@ -1,3 +1,5 @@
+"{ Package: 'stx:libbasic' }"
+
 OSHandle subclass:#OSFileHandle
 	instanceVariableNames:''
 	classVariableNames:'ConcreteClass'
@@ -59,8 +61,27 @@
 
 !OSFileHandle methodsFor:'finalization'!
 
+closeFile
+    "close the underlying file"
+
+    self subclassResponsibility
+
+!
+
 disposed
+    "a filedescriptor was garbage collected - close the underlying file"
 
+    self closeFile
+
+! !
+
+!OSFileHandle methodsFor:'release'!
+
+close
+    "close the file"
+
+    self closeFile.
+    self unregisterForFinalization.
 
 
 ! !
@@ -68,6 +89,6 @@
 !OSFileHandle class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/OSFileHandle.st,v 1.1 1999-09-18 11:14:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/OSFileHandle.st,v 1.2 2000-06-23 18:54:00 cg Exp $'
 ! !
 OSFileHandle initialize!
--- a/OSHandle.st	Fri Jun 23 20:48:24 2000 +0200
+++ b/OSHandle.st	Fri Jun 23 20:54:30 2000 +0200
@@ -1,6 +1,8 @@
+"{ Package: 'stx:libbasic' }"
+
 ExternalAddress subclass:#OSHandle
 	instanceVariableNames:''
-	classVariableNames:'Lobby'
+	classVariableNames:''
 	poolDictionaries:''
 	category:'System-Support'
 !
@@ -12,19 +14,8 @@
     self subclassResponsibility
 ! !
 
-!OSHandle methodsFor:'registration'!
-
-register
-    "register mySelf for later finalization"
-
-    Lobby isNil ifTrue:[
-        Lobby := Registry new.
-    ].
-    Lobby register:self
-! !
-
 !OSHandle class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/OSHandle.st,v 1.1 1999-09-18 11:14:44 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/OSHandle.st,v 1.2 2000-06-23 18:54:07 cg Exp $'
 ! !
--- a/UnixFileDescriptorHandle.st	Fri Jun 23 20:48:24 2000 +0200
+++ b/UnixFileDescriptorHandle.st	Fri Jun 23 20:54:30 2000 +0200
@@ -1,3 +1,5 @@
+"{ Package: 'stx:libbasic' }"
+
 OSFileHandle subclass:#UnixFileDescriptorHandle
 	instanceVariableNames:''
 	classVariableNames:''
@@ -15,8 +17,8 @@
 
 !UnixFileDescriptorHandle methodsFor:'finalization'!
 
-disposed
-    "a filedescriptor was garbage collected - close the underlying file"
+closeFile
+    "close the underlying file"
 
 %{
     INT fd = (INT)(__externalAddressVal(self));
@@ -29,26 +31,8 @@
 
 ! !
 
-!UnixFileDescriptorHandle methodsFor:'release'!
-
-close
-    "close the file"
-
-%{
-    INT fd = (INT)(__externalAddressVal(self));
-
-    if (fd > 0) {
-        __externalAddressVal(self) = (OBJ)-1;
-        close(fd);
-    }
-%}.
-    Lobby unregister:self
-
-
-! !
-
 !UnixFileDescriptorHandle class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/UnixFileDescriptorHandle.st,v 1.1 1999-09-18 11:11:04 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/UnixFileDescriptorHandle.st,v 1.2 2000-06-23 18:54:24 cg Exp $'
 ! !
--- a/UnixFileHandle.st	Fri Jun 23 20:48:24 2000 +0200
+++ b/UnixFileHandle.st	Fri Jun 23 20:54:30 2000 +0200
@@ -1,3 +1,5 @@
+"{ Package: 'stx:libbasic' }"
+
 OSFileHandle subclass:#UnixFileHandle
 	instanceVariableNames:''
 	classVariableNames:''
@@ -14,8 +16,8 @@
 
 !UnixFileHandle methodsFor:'finalization'!
 
-disposed
-    "a file handle was garbage collected - close the underlying file"
+closeFile
+    "close the underlying file"
 
 %{
     FILE *f = (FILE *)(__externalAddressVal(self));
@@ -28,25 +30,8 @@
 
 ! !
 
-!UnixFileHandle methodsFor:'release'!
-
-close
-    "close the file"
-
-%{
-    FILE *f = (FILE *)(__externalAddressVal(self));
-
-    if (f) {
-        __externalAddressVal(self) = NULL;
-        fclose(f);
-    }
-%}.
-    Lobby unregister:self
-
-! !
-
 !UnixFileHandle class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/UnixFileHandle.st,v 1.1 1999-09-18 11:10:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/UnixFileHandle.st,v 1.2 2000-06-23 18:54:30 cg Exp $'
 ! !