unit man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]

UNIT(3I)					       Last changed: 1-6-98

NAME
     UNIT - Returns the status of a BUFFER IN or BUFFER OUT statement

SYNOPSIS
     UNIT ([I=]i)

IMPLEMENTATION
     UNICOS, UNICOS/mk, and IRIX systems

STANDARDS
     CF90 and MIPSpro 7 Fortran 90 compiler extension to Fortran 90

DESCRIPTION
     After execution of asynchronous I/O with a BUFFER IN or BUFFER OUT
     statement, the execution sequence continues concurrently with the data
     transfer.	If UNIT is called in this execution sequence, the sequence
     is delayed until the transfer is complete.	 After the BUFFER IN
     operation, use UNIT or LENGTH(3I) before using memory locations where
     the data is stored.  UNIT accepts the following argument:

     i	  Must be an integer or Boolean value.	Represents a unit number.

     UNIT is a Fortran 90 elemental function.  The name of this intrinsic
     cannot be passed as an argument.

NOTES
     On UNICOS and UNICOS/mk systems, UNIT can be called as either an
     external subprogram or as an intrinsic procedure.

     On IRIX systems, the BUFFER IN and BUFFER OUT statements are used for
     synchronous I/O.  Asynchronous I/O is not available through BUFFER I/O
     on IRIX systems.

RETURN VALUES
     When the transfer is complete, UNIT returns a value of type real.	The
     value is of type REAL(KIND=8) on UNICOS and UNICOS/mk systems; it is
     of type REAL(KIND=4) on IRIX systems.  The returned value has one of
     the following meanings:

     Value     Meaning

     -2.0      A partial-record read terminated after delivering the
	       requested number of words or characters, but more data
	       remains in the record.  This status can be received only
	       after a BUFFER IN in partial record mode.

     -1.0      Operation was completed (indicates one of the following):

	       * A full- or partial-record BUFFER OUT operation completed.

	       * A full-record BUFFER IN completed, transferring as much of
		 the record as would fit in the space provided.

	       * A partial-record BUFFER IN completed, transferring as much
		 data as was left in the record (no more data remains in
		 the record).

	       * UNIT was called for an unconnected unit or for a unit on
		 which no BUFFER IN or BUFFER OUT operations have been
		 performed.

     0.0       An end-of-file was encountered on the previous BUFFER IN
	       operation.  No data was transferred.

     1.0       A partially recovered error occurred on the previous BUFFER
	       IN operation.  Use the LENGTH function to determine how much
	       data was transferred.

     2.0       An unrecovered error occurred on the last BUFFER IN or
	       BUFFER OUT operation.

EXAMPLES
	  PROGRAM TESTUNIT
	  DIMENSION M(200,5)
	  BUFFER IN(32,0) (M(1,1),M(200,5))
	  IF (UNIT(32) .EQ. -1.0) THEN
	     DO J = 1,5
	       DO I = 1,200
		 M(I,J) = M(I,J)*2
	       END DO
	     END DO
	     BUFFER OUT (22,0) (M(1,1),M(200,5))
	     IF (UNIT(22) .NE. -1.0) CALL ABORT
	  ELSE
	     CALL ABORT
	  ENDIF
	  END

SEE ALSO
     LENGTH(3I)

     Intrinsic Procedures Reference Manual, publication SR-2138, for the
     printed version of this man page.

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net