category-group: files
layer(s): 0, 2, 9, 10 header file(s): z_baredisk.h, z_filesubs.h, z_file.h, z_phpfile.h, z_imagefile.h, z_inifile.h, z_txtfilesubs.h, z_directory.h synopsis.
The "files" group refers to files and directories on a file system on a hard drive. Standard computer science terminology is invoked here - a "file" here is an agglomoration of bits, not something held by the FBI; a directory is synonymous with a Microsoft "folder"; a "hard drive" is an electronic device for holding these things, not a road trip around the Beltway or the Perimeter during rush hour. There are 5 groupings in the file zone:
- low-level functions (in layer 0);
- low-level objects (in layer 2) for managing hard drives;
- high-level class objects (file and directory),
- objects directly relating to a file or directory as an address. Since they are technically classified as "address objects", they fall under the address domain.
- more specialized objects, such as the PHP file processor object, the INI file object, or the image file object (see the respective links below).
layer 10 functions group description.
There is more than one syntax for describing a path in a file system. Historically, 2 major syntaxes have evolved: "unix" and "Microsoft". The basic difference between them is that unix systems have traditionally used a forward-slash character ('/') to separate directory names in a path, whereas Microsoft has used a back-slash ('\'). We avoid delving into the reasons for this ridiculous point of contention - such is the state of the world. When using paths, one can write a string in the format used by the underlying OS. This can lead to unportable code. To mitigate this problem, Vettrasoft created and recommends using the function z_DIRSEP() (header file entry in 'z02_func.h'), which returns a string object containing the correct character:
#include "z_file.h" void main() { string_o badpath = "c:\\Documents and Settings\\account\\TEMP"; string_o gudpath = string_o("C:") + z_DIRSEP(); gudpath += string_o("Documents and Settings") + z_DIRSEP(); gudpath += string_o("account") + z_DIRSEP() + "TEMP"; file_o f1(badpath), f2(gudpath); }In this example, the paths for the file objects f1 and f2 will both be set if the program runs on a Microsoft box, but the path given by 'badpath' uses invalid syntax in unix environments.
There is a logical blurring of groups with the advent of the image file object ( imagefile_o ). Image processing belongs in its own category, to which image files (.jpeg, .gif, .bmp etc) probably belong to - but at least for now, this component is with the files group.