LabWindows/CVI

Ini_WriteToFile

int Ini_WriteToFile (IniText handle, const char pathname[]);

Purpose

Writes the tag/value pairs in the list identified by handle to the file identified by pathname.

If you want to write the data to a destination other than a file, use the Ini_WriteGeneric function.

Parameters

Input
Name Type Description
handle IniText A handle returned from Ini_New. It represents the list of in-memory tag/value pairs.
pathname const char [] The pathname of the file to which to write the tag/value pairs. If a file with that pathname already exists, it will be overwritten.

If the pathname is not absolute, the file is created relative to the current working directory.

Pass 0 to write the tag/value pairs to the standard output stream.

Return Value

Name Type Description
status int Indicates whether the function was successful.

A zero indicates success.

A negative value indicates an error. If the value is from –1 to –999, it is one of the error values defined in userint.h. If the value is from –5000 to –5999, it is one of the error values defined in toolbox.h.

Among the more commonly encountered errors are:
–12 Out of memory!
–91 Too many files are open.
–93 Input/Output error.
–94 File not found.
–95 File access permission denied.
–97 Disk is full.
–99 File already open.
–100 Badly formed pathname.
–5003 Could not generate an unused temporary file name in the same directory as the output file.
–5004 Could not create a temporary file in the same directory as the output file.

Additional Information

Library: Reading/Writing .ini-Style Files

Include file: toolbox\inifile.h

LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later

Examples

Refer to the following examples that use the Ini_WriteToFile function:

  • compiler\versioning\versioning.cws

    Open example
  • toolbox\ini.cws

    Open example

Log in to get a better experience