Filename is a special class to handle filenames and paths. It is used to easily construct and edit paths, filenames and suffixes. It also allows to open dialogs to select files and directories.
Filename objects can be created on demand or can be obtained from other entities.
To retrieve and modify Filename objects stored in a BaseContainer respectively use:
See also BaseContainer Manual.
To retrieve and modify Filename objects stored in a GeData object (GeData type is DA_FILENAME) respectively use:
See also GeData Manual.
Important paths are obtained from:
A Filename can be constructed with basic operators:
A Filename object can easily be copied:
The content of a Filename object can be represented by a String:
See also String Manual (Classic).
A filename may be composed of a directory part and a file part. Each part can be edited independently:
Part of the filename may also be the file suffix. This suffix can be edited separately:
It is possible to get the suffix for a given image file type:
The memory mode allows to perform read and write operations on a memory block instead of a file on the hard drive. This is typically used to encrypt or compress the resulting data.
A Filename object is also useful to open dialogs to select files and folders:
The files that can be selected in a dialog can be filtered with these flags:
The type of dialog is defined with this flag:
A Filename object may also be used to reference a file located in Cinema 4D's content browser.
Two Filename objects can be compared easily:
A Filename object can be stored in a BaseFile or a HyperFile using: