creat64()--Create or Rewrite a File (Large File Enabled)


  Syntax
 #include <fcntl.h>

 int creat64(const char *path, mode_t mode);    
  Service Program Name: QP0LLIB1

  Default Public Authority: *USE

  Threadsafe: Conditional; see Usage Notes.

The creat64() function creates a new file or rewrites an existing file so that it is truncated to zero length. The open file instance created with creat64() is allowed to be larger than 2GB minus 1 byte. The function call

     creat64(path,mode);
is equivalent to the call
     open64(path, O_CREAT|O_WRONLY|O_TRUNC, mode);

If the file named by path does not already exist, it is created. The file is then opened for writing only and truncated to zero length. For further information, see open64()--Open File (Large File Enabled).

See QlgCreat64--Create or Rewrite a File (Large File Enabled) for a description and an example of supplying the path in any CCSID.

The mode argument specifies file permission bits to be used in creating the file. For more information on mode, see chmod()--Change File Authorizations.

For additional information about parameters, authorities required, error conditions, and examples, see creat()--Create or Rewrite File.


Usage Notes

  1. When you develop in C-based languages, the prototypes for the 64-bit APIs are normally hidden. To use the creat64() API, you must compile the source with _LARGE_FILE_API macro defined.

  2. All of the usage notes for creat() apply to creat64(). See Usage Notes in the creat() API.

API introduced: V4R4
Top | UNIX-Type APIs | APIs by category