Class WasiDirStub

    • Method Detail

      • close

        public void close()
                   throws IOException
        Description copied from interface: Closeable
        Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Throws:
        IOException - if an I/O error occurs
      • getType

        public FileType getType()
        Description copied from interface: WasiIO
        Gets the WasiIO file descriptor type.
        Specified by:
        getType in interface WasiIO
        Returns:
        the WasiIO file descriptor type.
      • wasiReadDir

        public int wasiReadDir​(int bufPtr,
                               int bufLen,
                               long cookie,
                               int resPtr,
                               byte[] memory)
        Specified by:
        wasiReadDir in interface WasiDir
      • wasigetPathFileStat

        public int wasigetPathFileStat​(int flags,
                                       int pathPtr,
                                       int pathLen,
                                       int filestatPtr,
                                       byte[] memory)
        Specified by:
        wasigetPathFileStat in interface WasiDir
      • wasiFilestatsSetTimes

        public int wasiFilestatsSetTimes​(int flags,
                                         int pathPtr,
                                         int pathLen,
                                         long accessTime,
                                         long modifiedTime,
                                         int fstFlags,
                                         byte[] memory)
        Adjust the timestamps of a file or directory. Note: This is similar to utimensat in POSIX. Note: Currently only sets the modified time, and does nothing when trying to change access time.
        Specified by:
        wasiFilestatsSetTimes in interface WasiDir
        Parameters:
        flags - Flags determining the method of how the path is resolved.
        pathPtr - pointer to path string
        pathLen - length of path
        accessTime - The desired values of the data access timestamp.
        modifiedTime - The desired values of the data modification timestamp.
        fstFlags - A bitmask indicating which timestamps to adjust. Bit 0 = Adjust the last data access timestamp to the value stored in accessTime Bit 1 = Adjust the last data access timestamp to the time of clock Bit 2 = Adjust the last data modification timestamp to the value stored in modifiedTime Bit 3 = Adjust the last data modification timestamp to the time of clock
        memory - WASI memory
        Returns:
        an ERRNO.
      • wasiOpenPath

        public int wasiOpenPath​(WasiIORegistry registry,
                                int dirflags,
                                int pathPtr,
                                int pathLen,
                                int oflags,
                                int fdPtr,
                                byte[] memory)
        Specified by:
        wasiOpenPath in interface WasiDir
      • wasiCreateDirectory

        public int wasiCreateDirectory​(int pathPtr,
                                       int pathLen,
                                       byte[] memory)
        Creates a directory in the same way that the posix mkdir() function would
        Specified by:
        wasiCreateDirectory in interface WasiDir
        Parameters:
        pathPtr - Pointer to a null-terminated string.
        pathLen - The length of the path string.
        memory - WASI memory
        Returns:
        Errno number.