Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference Intel® Fortran Libraries Reference

h.eng.cam.ac.uk
from h.eng.cam.ac.uk More from this publisher
12.07.2015 Views

2 Intel Fortran Libraries ReferenceBecause drives are identified by a single alphabetic character, GETDRIVESIZEQQ examinesonly the first letter of drive. The drive letter can be uppercase or lowercase. You can use theconstant FILE$CURDRIVE (defined in IFPORT.F90) to get the size of the current drive.If GETDRIVESIZEQQ fails, use GETLASTERRORQQ to determine the reason.CompatibilityCONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIBSee Also: “GETLASTERRORQQ”, “GETDRIVESQQ”, “GETDRIVEDIRQQ”,“CHANGEDRIVEQQ”,“CHANGEDIRQQ”Example! Program to demonstrate GETDRIVESQQ and GETDRIVESIZEQQUSE IFPORTCHARACTER(26) drivesCHARACTER(1) adriveLOGICAL(4) statusINTEGER(4) total, availINTEGER(2) i! Get the list of drivesdrives = GETDRIVESQQ()WRITE (*,'(A, A)') ' Drives available: ', drives!!Cycle through them for free space and write to consoleDO i = 1, 26adrive = drives(i:i)status = .FALSE.WRITE (*,'(A, A, A, \)') ' Drive ', CHAR(i + 64), ':'IF (adrive .NE. ' ') THENstatus = GETDRIVESIZEQQ(adrive, total, avail)END IFIF (status) THENWRITE (*,*) avail, ' of ', total, ' bytes free.'ELSEWRITE (*,*) 'Not available'END IFEND DOEND2-114

Descriptions of the Library Routines 2GETDRIVESQQGETENVPortability Function: Reports which drives are available to the system.Module: USE IFPORTSyntaxresult = GETDRIVESQQ ( )Results:The result type is character with length 26. It is the positional character string containing theletters of the drives available in the system.The returned string contains letters for drives that are available, and blanks for drives that are notavailable. For example, on a system with A, C, and D drives, the string 'A CD ' is returned.On Linux* systems, the function returns a string filled with spaces.CompatibilityCONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS DLL LIBSee Also: “GETDRIVEDIRQQ”, “GETDRIVESIZEQQ”, “CHANGEDRIVEQQ”ExampleSee the example for “GETDRIVESIZEQQ”.Portability Subroutine: Returns the value of an environment variable.Module: USE IFPORTSyntaxCALL GETENV (ename, evalue)ename(Input) Character*(*). Environment variable to search for.evalue(Output) Character*(*). Value found for ename. Blank if ename is not found.CompatibilityCONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIBSee Also: “GETENVQQ”Exampleuse IFPORT2-115

Descriptions of the Library Routines 2GETDRIVESQQGETENVPortability Function: Reports which drives are available to the system.Module: USE IFPORTSyntaxresult = GETDRIVESQQ ( )Results:The result type is character with length 26. It is the positional character string containing theletters of the drives available in the system.The returned string contains letters for drives that are available, and blanks for drives that are notavailable. For example, on a system with A, C, and D drives, the string 'A CD ' is returned.On Linux* systems, the function returns a string filled with spaces.CompatibilityCONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS DLL LIBSee Also: “GETDRIVEDIRQQ”, “GETDRIVESIZEQQ”, “CHANGEDRIVEQQ”ExampleSee the example for “GETDRIVESIZEQQ”.Portability Subroutine: Returns the value of an environment variable.Module: USE IFPORTSyntaxCALL GETENV (ename, evalue)ename(Input) Character*(*). Environment variable to search for.evalue(Output) Character*(*). Value found for ename. Blank if ename is not found.CompatibilityCONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIBSee Also: “GETENVQQ”Exampleuse IFPORT2-115

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!