Skip to content

File.OpenFlags is missing a no_follow field #18327

Description

@squeek502

Dir.OpenDirOptions has a no_follow field:

zig/lib/std/fs/Dir.zig

Lines 1336 to 1337 in f36ac22

/// `true` means it won't dereference the symlinks.
no_follow: bool = false,

The same field should be present in File.OpenFlags

Depends on #16606 being resolved to allow implementing no_follow for Dir.access on Linux. #16738 is also potentially relevant.


EDIT: It may actually be impossible to implement this for all supported platforms, MacOS/Darwin doesn't seem to support getting a file descriptor of a symlink itself (no O_PATH flag for the open syscall).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.standard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions