Skip to content

Commit

Permalink
Document that filesystem timestamps can be 0. (#124)
Browse files Browse the repository at this point in the history
* Document that filesystem timestamps can be 0.

A value of 0 in a timestamp indicates the time is unknown. This
ports #531 from Preview 1 to Preview 2.

* Fix a copy+pasto.

* Regenerate example-world.md.

* Switch to `option` instead of special-casing 0.
  • Loading branch information
sunfishcode authored Sep 13, 2023
1 parent 69b8e30 commit 9675a4b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
14 changes: 10 additions & 4 deletions example-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -754,16 +754,22 @@ with the filesystem.
length in bytes of the pathname contained in the symbolic link.
</li>
<li>
<p><a name="descriptor_stat.data_access_timestamp"><code>data-access-timestamp</code></a>: <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></p>
<p><a name="descriptor_stat.data_access_timestamp"><code>data-access-timestamp</code></a>: option&lt;<a href="#datetime"><a href="#datetime"><code>datetime</code></a></a>&gt;</p>
<p>Last data access timestamp.
<p>If the <code>option</code> is none, the platform doesn't maintain an access
timestamp for this file.</p>
</li>
<li>
<p><a name="descriptor_stat.data_modification_timestamp"><code>data-modification-timestamp</code></a>: <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></p>
<p><a name="descriptor_stat.data_modification_timestamp"><code>data-modification-timestamp</code></a>: option&lt;<a href="#datetime"><a href="#datetime"><code>datetime</code></a></a>&gt;</p>
<p>Last data modification timestamp.
<p>If the <code>option</code> is none, the platform doesn't maintain a
modification timestamp for this file.</p>
</li>
<li>
<p><a name="descriptor_stat.status_change_timestamp"><code>status-change-timestamp</code></a>: <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></p>
<p>Last file status change timestamp.
<p><a name="descriptor_stat.status_change_timestamp"><code>status-change-timestamp</code></a>: option&lt;<a href="#datetime"><a href="#datetime"><code>datetime</code></a></a>&gt;</p>
<p>Last file status-change timestamp.
<p>If the <code>option</code> is none, the platform doesn't maintain a
status-change timestamp for this file.</p>
</li>
</ul>
<h4><a name="advice"><code>enum advice</code></a></h4>
Expand Down
17 changes: 13 additions & 4 deletions wit/types.wit
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,20 @@ interface types {
/// length in bytes of the pathname contained in the symbolic link.
size: filesize,
/// Last data access timestamp.
data-access-timestamp: datetime,
///
/// If the `option` is none, the platform doesn't maintain an access
/// timestamp for this file.
data-access-timestamp: option<datetime>,
/// Last data modification timestamp.
data-modification-timestamp: datetime,
/// Last file status change timestamp.
status-change-timestamp: datetime,
///
/// If the `option` is none, the platform doesn't maintain a
/// modification timestamp for this file.
data-modification-timestamp: option<datetime>,
/// Last file status-change timestamp.
///
/// If the `option` is none, the platform doesn't maintain a
/// status-change timestamp for this file.
status-change-timestamp: option<datetime>,
}

/// Flags determining the method of how paths are resolved.
Expand Down

0 comments on commit 9675a4b

Please sign in to comment.