github.com/tetratelabs/wazero@v1.2.1/internal/fsapi/constants_windows.go (about)

     1  package fsapi
     2  
     3  import "syscall"
     4  
     5  // Windows does not have these constants, we declare placeholders which should
     6  // not conflict with other open flags. These placeholders are not declared as
     7  // value zero so code written in a way which expects them to be bit flags still
     8  // works as expected.
     9  //
    10  // Since those placeholder are not interpreted by the open function, the unix
    11  // features they represent are also not implemented on windows:
    12  //
    13  //   - O_DIRECTORY allows programs to ensure that the opened file is a directory.
    14  //     This could be emulated by doing a stat call on the file after opening it
    15  //     to verify that it is in fact a directory, then closing it and returning an
    16  //     error if it is not.
    17  //
    18  //   - O_NOFOLLOW allows programs to ensure that if the opened file is a symbolic
    19  //     link, the link itself is opened instead of its target.
    20  const (
    21  	O_DIRECTORY = 1 << 29
    22  	O_NOFOLLOW  = 1 << 30
    23  	O_NONBLOCK  = syscall.O_NONBLOCK
    24  )