From 668b9e2159c0ff8ca06436b33213c53e13d56dac Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Wed, 8 Nov 2023 11:39:38 -0800 Subject: [PATCH 1/2] types.wit: delete file mode accessors and setters We believe there is value in supporting file modes for many applications, but for the sake of shipping Preview 2, we are out of time to implement these methods and test a a cross platform implementation of these in two separate engines. These functions may come back as part of an additional filesystem interface in a post Preview 2 patch version 0.2.n, or in Preview 3 or beyond. Until then, their design is still in the git history. --- wit/types.wit | 78 --------------------------------------------------- 1 file changed, 78 deletions(-) diff --git a/wit/types.wit b/wit/types.wit index 7ac147f..3bd8dc7 100644 --- a/wit/types.wit +++ b/wit/types.wit @@ -142,29 +142,6 @@ interface types { truncate, } - /// Permissions mode used by `open-at`, `change-file-permissions-at`, and - /// similar. - flags modes { - /// True if the resource is considered readable by the containing - /// filesystem. - readable, - /// True if the resource is considered writable by the containing - /// filesystem. - writable, - /// True if the resource is considered executable by the containing - /// filesystem. This does not apply to directories. - executable, - } - - /// Access type used by `access-at`. - variant access-type { - /// Test for readability, writeability, or executability. - access(modes), - - /// Test whether the path exists. - exists, - } - /// Number of hard links to an inode. type link-count = u64; @@ -538,8 +515,6 @@ interface types { open-flags: open-flags, /// Flags to use for the resulting descriptor. %flags: descriptor-flags, - /// Permissions to use when creating a new file. - modes: modes ) -> result; /// Read the contents of a symbolic link. @@ -588,25 +563,6 @@ interface types { new-path: string, ) -> result<_, error-code>; - /// Check accessibility of a filesystem path. - /// - /// Check whether the given filesystem path names an object which is - /// readable, writable, or executable, or whether it exists. - /// - /// This does not a guarantee that subsequent accesses will succeed, as - /// filesystem permissions may be modified asynchronously by external - /// entities. - /// - /// Note: This is similar to `faccessat` with the `AT_EACCESS` flag in POSIX. - access-at: func( - /// Flags determining the method of how the path is resolved. - path-flags: path-flags, - /// The relative path to check. - path: string, - /// The type of check to perform. - %type: access-type - ) -> result<_, error-code>; - /// Unlink a filesystem object that is not a directory. /// /// Return `error-code::is-directory` if the path refers to a directory. @@ -616,40 +572,6 @@ interface types { path: string, ) -> result<_, error-code>; - /// Change the permissions of a filesystem object that is not a directory. - /// - /// Note that the ultimate meanings of these permissions is - /// filesystem-specific. - /// - /// Note: This is similar to `fchmodat` in POSIX. - change-file-permissions-at: func( - /// Flags determining the method of how the path is resolved. - path-flags: path-flags, - /// The relative path to operate on. - path: string, - /// The new permissions for the filesystem object. - modes: modes, - ) -> result<_, error-code>; - - /// Change the permissions of a directory. - /// - /// Note that the ultimate meanings of these permissions is - /// filesystem-specific. - /// - /// Unlike in POSIX, the `executable` flag is not reinterpreted as a "search" - /// flag. `read` on a directory implies readability and searchability, and - /// `execute` is not valid for directories. - /// - /// Note: This is similar to `fchmodat` in POSIX. - change-directory-permissions-at: func( - /// Flags determining the method of how the path is resolved. - path-flags: path-flags, - /// The relative path to operate on. - path: string, - /// The new permissions for the directory. - modes: modes, - ) -> result<_, error-code>; - /// Test whether two descriptors refer to the same filesystem object. /// /// In POSIX, this corresponds to testing whether the two descriptors have the From d9e728e6bc4f20330f6930f2a64d47168748aa01 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Wed, 8 Nov 2023 11:40:58 -0800 Subject: [PATCH 2/2] generate markdown --- imports.md | 89 ------------------------------------------------------ 1 file changed, 89 deletions(-) diff --git a/imports.md b/imports.md index 2cbf690..c5c7d17 100644 --- a/imports.md +++ b/imports.md @@ -569,40 +569,6 @@ expanded.

Truncate file to size 0, similar to `O_TRUNC` in POSIX. -

flags modes

-

Permissions mode used by open-at, change-file-permissions-at, and -similar.

-
Flags members
-
    -
  • -

    readable:

    -

    True if the resource is considered readable by the containing -filesystem. -

  • -
  • -

    writable:

    -

    True if the resource is considered writable by the containing -filesystem. -

  • -
  • -

    executable:

    -

    True if the resource is considered executable by the containing -filesystem. This does not apply to directories. -

  • -
-

variant access-type

-

Access type used by access-at.

-
Variant Cases
-
    -
  • -

    access: modes

    -

    Test for readability, writeability, or executability. -

  • -
  • -

    exists

    -

    Test whether the path exists. -

  • -

type link-count

u64

Number of hard links to an inode. @@ -1171,7 +1137,6 @@ contains truncate or create, and the base descriptor d

  • path: string
  • open-flags: open-flags
  • flags: descriptor-flags
  • -
  • modes: modes
  • Return values