Skip to content

Commit 7093b2f

Browse files
committed
Split delete into two APIs.
Closes #2
1 parent 21c5dfc commit 7093b2f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/lib.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,19 @@ pub struct Api {
109109
pub stat: extern "C" fn(path: file::Path) -> Result<file::Stat>,
110110
/// Get information about an open file.
111111
pub fstat: extern "C" fn(fd: file::Handle) -> Result<file::Stat>,
112-
/// Delete a file or directory.
112+
/// Delete a file.
113113
///
114114
/// # Limitations
115115
///
116116
/// * You cannot delete a file if it is currently open.
117+
pub deletefile: extern "C" fn(path: file::Path) -> Result<()>,
118+
/// Delete a directory.
119+
///
120+
/// # Limitations
121+
///
117122
/// * You cannot delete a root directory.
118-
/// * You cannot delete a directory that has any files in it.
119-
pub delete: extern "C" fn(path: file::Path) -> Result<()>,
123+
/// * You cannot delete a directory that has any files or directories in it.
124+
pub deletedir: extern "C" fn(path: file::Path) -> Result<()>,
120125
/// Change the current directory.
121126
///
122127
/// Relative file paths (e.g. passed to `Api::open`) are taken to be relative to the current directory.

0 commit comments

Comments
 (0)