Documentation › Modules › Datafile.em

File: Datafile.em

Functions to access generic data files.

Last modified: 10/27/2007

File Constants

// OpenDataFile flags:
// can specify only one of the following:
const DF_KEYTYPE_STRING       := 0x00; // default
const DF_KEYTYPE_INTEGER      := 0x01;

CreateDataFile( filespec, flags := DF_KEYTYPE_STRING )#

Parameters

filespec String
flags Integer

Explanation

Creates a new data file.
filespec is in normal package descriptor format. 'filename' or '::filename' will create the new data file /data/ds/filename. ':pkgname:filename' will create /data/ds/pkgname/filename.
flags specifies if the keys of the new datafile are strings OR integers.

Return values

DataFile Reference. See the DataFile object documentation.

Errors

  • "Error in descriptor"
  • "An exception occurred"
  • "Invalid parameter type"

Related

ListDataFiles()#

Explanation

Returns an array of structs containing:
.pkg - name of the package the datafile belongs to
.name - name of the file
.descriptor - :pkg:name

Return values

Array of Structs

Related

OpenDataFile( filespec )#

Parameters

filespec String

Explanation

Opens a datafile for access.
filespec is in normal package descriptor format. 'filename' or '::filename' will open the data file /data/ds/filename. ':pkgname:filename' will open /data/ds/pkgname/filename.

Return values

DataFile Reference. See the DataFile object documentation.

Errors

  • "Datafile does not exist"
  • "Error in descriptor"
  • "An exception occurred"
  • "Invalid parameter type"

Related

UnloadDataFile( filespec )#

Parameters

filespec String

Explanation

Unloads a datafile
filespec is in normal package descriptor format. 'filename' or '::filename' will unload the data file /data/ds/filename. ':pkgname:filename' will unload /data/ds/pkgname/filename.

Return values

1 on success

Errors

  • "Unable to find data store file"
  • "Invalid parameter type"

Related