OpenVMSFileHandle.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 12 Jun 2019 15:02:01 +0100
branchjv
changeset 24334 e82c3f5bc1f1
parent 17911 a99f15c5efa5
permissions -rw-r--r--
Issue #259: fix `ProjectDefinition >> classesForPlatform` and use it `#testSuite` THis allows packages to specify testcases valid for some platform only. This is normally not needed but sometimes the testcase uses a class that is platform specific and this will cause package validation error upon commit.

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 $'
! !