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 about 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. QFileSvr.400 File System Differences

    When connecting to a system at release V5R4M5 and earlier, QFileSvr.400 does not support creat64() on an existing file larger than 2GB minus 1 byte, [EOVERFLOW] will be returned.

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

API introduced: V4R4

[ Back to top | UNIX-Type APIs | APIs by category ]