Skip to content

Zig fmt creates backup file when using full path #4606

@BarabasGitHub

Description

@BarabasGitHub

On Windows using 0.5.0+6a0927d8c

Whenever I use zig fmt with a full path name it makes a file with a name like tCO3sAUiRk2cKtTK.
I'm not entirely sure when it does and when it doesn't create the file. Also sometimes it's empty, but sometimes it contains the old contents?
Maybe it's empty if the file is smaller than 4k?

It seems to be created consistently when I run this powershell code:

ForEach ($item in (Get-ChildItem -Recurse *.zig)) {
    zig fmt $item.FullName;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorcontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.os-windowsMicrosoft Windowsstandard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions