Skip to content

Commit e84d1dc

Browse files
authored
Merge pull request #100 from kinode-dao/hf/vfs-file-drop-file-is-close
vfs: file drop file is close
2 parents 809c3a5 + 18a11bc commit e84d1dc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/vfs/file.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,14 @@ impl File {
323323
}
324324
}
325325

326+
impl Drop for File {
327+
fn drop(&mut self) {
328+
vfs_request(&self.path, VfsAction::CloseFile)
329+
.send()
330+
.unwrap();
331+
}
332+
}
333+
326334
/// Creates a drive with path "/package_id/drive", gives you read and write caps.
327335
/// Will only work on the same package_id as you're calling it from, unless you
328336
/// have root capabilities.

0 commit comments

Comments
 (0)