# LoadStreamF

Creates new stream and reads stream descriptive data from binary file.

## Syntax

Fortran:

errstatus = vslloadstreamf( stream, fname )

C:

errstatus = vslLoadStreamF( &stream, fname );

## Description

This function creates a new stream and reads stream descriptive data from the binary file. A new random stream is created using the stream descriptive data from the binary file with the name fname. If the stream cannot be read (for example, I/O error occurs or the file format is invalid), errstatus has a non-zero value. To save random stream to the file, use SaveStreamF function.

## Input Parameters

Name | Type | Description
--- | --- | ---
fname | FORTRAN: CHARACTER(*), INTENT(IN) C: char* | FORTRAN: File name specified as a C-style null-terminated string C: File name specified as a Fortran-style character string

## Output Parameters

Name | Type | Description
--- | --- | ---
stream | FORTRAN: TYPE(VSL_STREAM_STATE), INTENT(OUT) C: VSLStreamStatePtr* | FORTRAN: Descriptor of a new random stream C: Pointer to a new random stream
errstatus | FORTRAN: INTEGER C: int | Error status of the operation

## Return Values

VSL_ERROR_OK, VSL_STATUS_OK
  Indicates no error, execution is successful.
VSL_ERROR_NULL_PTR
  fname is a NULL pointer.
VSL_ERROR_FILE_OPEN

  Indicates an error in opening the file.

VSL_ERROR_FILE_WRITE

  Indicates an error in writing the file.

VSL_ERROR_FILE_CLOSE

  Indicates an error in closing the file.

VSL_ERROR_MEM_FAILURE

  System cannot allocate memory for internal needs.

VSL_ERROR_BAD_FILE_FORMAT

  Unknown file format.

VSL_ERROR_UNSUPPORTED_FILE_VER

  File format version is unsupported.

Parent topic: Service Routines