# SaveStreamF

Writes random stream descriptive data to binary file.

## Syntax

Fortran:

errstatus = vslsavestreamf( stream, fname )

C:

errstatus = vslSaveStreamF( stream, fname );

## Description

This function writes the random stream descriptive data to the binary file. Random stream descriptive data is saved to the binary file with the name fname. Random stream stream must be a valid stream created by NewStream-like or CopyStream-like service routines. If the stream cannot be saved to the file, errstatus has a non-zero value. Random stream can be read from the binary file using LoadStreamF function.

## Input Parameters

Name | Type | Description
--- | --- | ---
stream | FORTRAN: TYPE(VSL_STREAM_STATE), INTENT(IN) C: VSLStreamStatePtr | Random stream to be written to the file
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
--- | --- | ---
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
  Either fname or stream is a NULL pointer.
VSL_ERROR_BAD_STREAM

  stream is not a valid random stream.

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.

Parent topic: Service Routines