SCL Reference: file_open() Function

The SCL file_open() function opens a file for subsequent reading.

file_open(fileOpenStatus,     // file_open_status variable
          fileVar,            // file variable
          fileName,           // file name, String variable
          fileMode)           // file mode (must be read_mode)

fileOpenStatus is a variable of type file_open_status. It receives the status result of the file open operation. It's values can be

mode_error       // no longer used
name_error       // file not found
open_ok          // file successfully opened
status_error     // file already opened

fileVar is a variable of type file. It is the internal variable that tracks the file state. It is used in other file methods like endfile and file_close.

fileName is a string containing the file name. It must contain the complete absolute path.

fileMode is a constant of type file_mode, however at this time the value must be "read_mode"

© 2016 Microchip Technology, Inc.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.