Skip to content

Windows: ftruncate to shrink file gives EPERM #3177

@jorangreef

Description

@jorangreef

I have a file with the following stats in a Windows VM:

{"dev":-24039965,"mode":33206,"nlink":1,"uid":0,"gid":0,"rdev":0,"ino":562949953548321,"size":39035842,"atime":"2015-10-03T09:59:32.677Z","mtime":"2015-10-03T10:00:17.241Z","ctime":"2015-10-03T10:00:17.241Z","birthtime":"2015-10-03T09:59:32.677Z"}

Truncating this file using ftruncate from 39035842 to 38839234 byte (to make it smaller) gives EPERM.

Is ftruncate simply not supported at all on Windows? I thought it was only ftruncate to enlarge a file that was not permitted on Windows?

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.fsIssues and PRs related to the fs subsystem / file system.questionIssues that look for answers.windowsIssues and PRs related to the Windows platform.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions