FCreate (LabVIEW Manager Function)

MgErr FCreate(fdp, path, permissions, openMode, denyMode, group);

Purpose

Creates a file with the name and location specified by path and with the specified permissions, and opens it for writing and reading, as specified by openMode. If the file already exists, the function returns an error.

You can use denyMode to control concurrent access to the file from within LabVIEW. You can use the group parameter to assign the file to a Linux group. LabVIEW ignores group on Windows and Mac OS X.

If the function creates the file, the resulting file descriptor is stored in the address referred to by fdp. If an error occurs, the function stores 0 in the address referred to by fdp and returns an error.

Note  Before you call this function, ensure that you understand how to use pointers as parameters.

Parameters

Name Type Description
fdp File * Address at which FCreate stores the file descriptor for the new file. If FCreate fails, it stores 0 in the address fdp. This parameter is a pointer.
path Path Path of the file you want to create.
permissions int32 Permissions to assign to the new file.
openMode int32 Access mode to use in opening the file. The following values are defined in the file extcode.h.
  • openReadOnly—Open for reading.
  • openWriteOnly—Open for writing.
  • openReadWrite—Open for both reading and writing.
denyMode int32 Mode that determines what level of concurrent access to the file is allowed. The following values are defined in the file extcode.h.
  • denyReadWrite—Prevents others from reading from and writing to the file while it is open.
  • denyWriteOnly—Prevents others from writing to the file only while it is open.
  • denyNeither—Allows others to read from and write to the file while it is open.
group PStr Linux group you want to assign to the new file.

Return Value

MgErr, which can contain the following errors. If you receive errors from LabVIEW Manager functions, most error names correspond to LabVIEW error codes.

Value Corresponding Error Code or Description
noErrNo error.
mgArgErr1
fIsOpen5. This error is returned only on Mac OS X. Windows returns fIOErr.
fIOErr6
fNoPerm8
fDupPath10
fTMFOpen11