Function creating or opening file and system streams.
Stream factory functions create a stream object bound to a system file. As the open or create operation may fail, using a factory function is more appropriate, as they can avoid creating the underlying stream object when not needed. Also, they can setup the proper stream subclass to manage special files.
Stream factory function often accept a parameter to determine the sharing mode. Only some systems implements correctly this functionality, so use with caution. Predefined constant that can be used as share mode are:
- FILE_EXCLUSIVE: The calling scripts own the shared file; other processes trying to open the file, or even the same process, should receive an error.
Function creating files, as IOStream() and OutputStream() accepts also a creation ownership mode. This is actually an octal number that is directly passed to the POSIX systems for directory ownership creation. It has currently no meaning for MS-Windows systems.