fopen

Parent Previous Next

fopen

y = fopen ( filename,mode )

Opens a file with the given mode

arg

type

Description

Unit or Value scale

filename

TXT

Name of the file to open


mode

TXT

File open mode, such as "r" "w" "a" "rb" "rt" "wb" "wt"


Outputs

  • y is SCAL indicating the file identifier. y is -1 if there's an error.

Notes

  • Internally, the C fopen function is called with the given arguments.
  • Make sure to open the file as binary (use "wb") when opening a binary file (one of most frequent mistakes!)

Examples

See Also

fclose | fprintf | fread | fwrite

Created with the Personal Edition of HelpNDoc: Easily create Web Help sites