A collection of routines to read and write node-based files for CMISS and CMGUI. All file features should be supported, including multiple node-groups, derivatives and versions.
use CmUtils::File qw(readExnode writeIpnode);
will make available the two routines. The read routines return one or more node-groups.
use CmUtils::File qw(:Exnode :Ipnode);
which will make the read and write Exnode and Ipnode routines available.
$group = readExnode("file.exnode"); writeIpnode("newfile.ipnode", $group);
Generic routines are also available, which determine the file type from the file extensions, or from a format option. These routines (cmRead and cmWrite) are exported by default.
use CmUtils::File; $group = cmRead('file.ipnode'); $options->{format}='exdata'; cmWrite('newfile', $group, $options);
Available tags to use are
:all for all routines
:Exnode for readExnode and writeExnode
:Exdata for readExdata and writeExdata
:Ipnode for readIpnode and writeIpnode
:Ipdata for readIpdata and writeIpdata
:Ipfiel for readIpfiel and writeIpfiel
:Ipfibr for readIpfibr and writeIpfibr
:Ascii for readAscii and writeAscii
0.6 (6 November 2000)
The following generic subroutines are exported by default:
cmRead cmWrite
The following subroutines are imported from the File modules, and are exported on request:
readExnode writeExnode readExdata writeExdata readIpnode writeIpnode readIpdata writeIpdata readIpfiel writeIpfiel readIpfibr writeIpfibr readAscii writeAscii
Generic file reading routine for CMISS Ip and Ex format files. File format is determined from the options hash if possible, otherwise it should be specified in the filename.
$group = cmRead('file.ipnode');
$o->{format}='exdata'; $g = cmRead('file', $o);
Generic file writing routine for CMISS Ip and Ex format files. File format is determined from the options hash if possible, otherwise it should be specified in the filename.
cmWrite('file.ipnode', $group);
$o->{format}='exdata'; cmWrite('file', $g, $o);
ipxi?