OpenVMSFileHandle.st
author Jan Vrany <jan.vrany@labware.com>
Wed, 23 Jun 2021 12:50:05 +0100
branchjv
changeset 25430 acd92449dc30
parent 17911 a99f15c5efa5
permissions -rw-r--r--
`Process`: revert `#interruptWith:` Commit 3b02b0f1f647: Cherry-picked `Semaphore`, `EventSemaphore, `Process` and `ProcessorScheduler` changes `Process >> #interruptWith:` but this - for not yet known reason - breaks stx:libjava tests. This commit reverts the code to version before that commit, fixing tests.

OSFileHandle subclass:#OpenVMSFileHandle
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'OS-OpenVMS'
!

!OpenVMSFileHandle primitiveDefinitions!
%{
#include <stdio.h>
%}

! !


!OpenVMSFileHandle methodsFor:'finalization'!

disposed
    "a file handle was garbage collected - close the underlying file"

%{
    FILE *f = (FILE *)(__externalAddressVal(self));

    if (f) {
        __externalAddressVal(self) = NULL;
        fclose(f);
    }
%}



! !

!OpenVMSFileHandle methodsFor:'release'!

close
    "close the file"

%{
    FILE *f = (FILE *)(__externalAddressVal(self));

    if (f) {
        __externalAddressVal(self) = NULL;
        fclose(f);
    }
%}.
    Lobby unregister:self



! !

!OpenVMSFileHandle class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic/OpenVMSFileHandle.st,v 1.1 1999/09/18 11:11:28 cg Exp $'
! !