Skip to content

Commit 9675a4b

Browse files
authored
Document that filesystem timestamps can be 0. (WebAssembly#124)
* 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.
1 parent 69b8e30 commit 9675a4b

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

example-world.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -754,16 +754,22 @@ with the filesystem.
754754
length in bytes of the pathname contained in the symbolic link.
755755
</li>
756756
<li>
757-
<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>
757+
<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>
758758
<p>Last data access timestamp.
759+
<p>If the <code>option</code> is none, the platform doesn't maintain an access
760+
timestamp for this file.</p>
759761
</li>
760762
<li>
761-
<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>
763+
<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>
762764
<p>Last data modification timestamp.
765+
<p>If the <code>option</code> is none, the platform doesn't maintain a
766+
modification timestamp for this file.</p>
763767
</li>
764768
<li>
765-
<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>
766-
<p>Last file status change timestamp.
769+
<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>
770+
<p>Last file status-change timestamp.
771+
<p>If the <code>option</code> is none, the platform doesn't maintain a
772+
status-change timestamp for this file.</p>
767773
</li>
768774
</ul>
769775
<h4><a name="advice"><code>enum advice</code></a></h4>

wit/types.wit

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,20 @@ interface types {
107107
/// length in bytes of the pathname contained in the symbolic link.
108108
size: filesize,
109109
/// Last data access timestamp.
110-
data-access-timestamp: datetime,
110+
///
111+
/// If the `option` is none, the platform doesn't maintain an access
112+
/// timestamp for this file.
113+
data-access-timestamp: option<datetime>,
111114
/// Last data modification timestamp.
112-
data-modification-timestamp: datetime,
113-
/// Last file status change timestamp.
114-
status-change-timestamp: datetime,
115+
///
116+
/// If the `option` is none, the platform doesn't maintain a
117+
/// modification timestamp for this file.
118+
data-modification-timestamp: option<datetime>,
119+
/// Last file status-change timestamp.
120+
///
121+
/// If the `option` is none, the platform doesn't maintain a
122+
/// status-change timestamp for this file.
123+
status-change-timestamp: option<datetime>,
115124
}
116125

117126
/// Flags determining the method of how paths are resolved.

0 commit comments

Comments
 (0)