gdaWrite32

Purpose

Writes a variable to a GAUSS Data Archive using 32-bit system file write commands.

Format

retcode = gdaWrite32(filename, x, varname)
Parameters:
  • filename (string) – name of data file.
  • x (matrix or array or string or string array) – data to write to the GDA.
  • varname (string) – variable name.
Returns:

retcode (scalar) –

return code, 0 if successful, otherwise one of the following error codes:

1 Null file name.
2 File open error.
3 File write error.
4 File read error.
5 Invalid data file type.
9 Variable name too long.
11 Variable name must be unique.
14 File too large to be read on current platform.
25 Not supported for use with a file created on a machine with a different byte order.

Examples

// Generate random variable x
x = rndn(100, 50);

// Create GDA `myFile`
retcode1 = gdaCreate("myfile.gda", 1);

// Write `x`  to `myfile` as x1
retcode2 = gdaWrite32("myfile.gda", x, "x1");

Remarks

gdaWrite32() adds the data in x to the end of the variable data in filename, and gives the variable the name contained in varname.

This command is a speed optimization command for Windows. On all other platforms, this function is identical to gdaWrite(). gdaWrite() uses system file write commands that support 64-bit file sizes. These commands are slower on Windows XP than the 32-bit file write commands that were used for binary writes in GAUSS 6.0 and earlier. gdaWrite32() uses the 32-bit Windows system write commands, which will be faster on Windows XP. Note, however, that gdaWrite32() does not support 64-bit file sizes.

This command does not support writing to a GDA that was created on a platform with a different byte order than the current machine. gdaWrite() supports full cross-platform writing to GDA’s.

See also

Functions gdaWrite(), gdaCreate()