Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

fopen (MathScript Function) (Windows, Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the support class.

Syntax

fid = fopen('all')

fid = fopen(filename)

fid = fopen(filename, mode)

Description

Opens a file.

Details

Examples

Inputs

Name Description
'all' Returns the specifiers for all open files.
filename Specifies the path to the file you want to open. If filename is a relative path, LabVIEW searches for the file in the current directory. filename is a string.
mode Specifies how to open the file. mode is a string that accepts the following values.

'a' Opens an existing file as write-only or creates a new file. LabVIEW appends new data to the end of the existing file.
'a+' Opens an existing file as read-write or creates a new file. LabVIEW appends new data to the end of the existing file.
'r' (default) Opens an existing file as read-only.
'r+' Opens an existing file as read-write.
'w' Opens an existing file as write-only or creates a new file. LabVIEW discards the contents of the existing file.
'w+' Opens an existing file as read-write or creates a new file. LabVIEW discards the contents of the existing file.

Outputs

Name Description
fid Returns an identifier for the file you opened. You can use fid to specify the file you want to use with the fread or fwrite functions. fid is an integer. If you specify fopen('all'), fid returns the identifiers for all open files as a vector of integers.

Details

If you include this function in a stand-alone application or shared library, and filename is a relative path, LabVIEW begins searching for the file in the directory where you installed the application or shared library.

Examples

fid = fopen('Test.m');
fclose(fid);

Related Topics

fclose
fread
fseek
fwrite


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit