Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-4109

FileSystem support for posix truncate method

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • fs
    • None

    Description

          void truncate(Path path, long offset) throws IOException;
      
      

      from man truncate:

      DESCRIPTION
      The truncate and ftruncate functions cause the regular file named by path or referenced by fd to be truncated to a size of precisely length bytes.

      If the file previously was larger than this size, the extra data is lost. If the file previously was shorter, it is extended, and the extended part reads as zero bytes.

      The file pointer is not changed.

      If the size changed, then the ctime and mtime fields for the file are updated, and suid and sgid mode bits may be cleared.

      With ftruncate, the file must be open for writing; with truncate, the file must be writable.

      RETURN VALUE
      On success, zero is returned. On error, -1 is returned, and errno is set appropriately.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              wyckoff Pete Wyckoff
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: