Skip to content

Commit

Permalink
Merge pull request #100 from kinode-dao/hf/vfs-file-drop-file-is-close
Browse files Browse the repository at this point in the history
vfs: file drop file is close
  • Loading branch information
nick1udwig authored Oct 1, 2024
2 parents 809c3a5 + 18a11bc commit e84d1dc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/vfs/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,14 @@ impl File {
}
}

impl Drop for File {
fn drop(&mut self) {
vfs_request(&self.path, VfsAction::CloseFile)
.send()
.unwrap();
}
}

/// Creates a drive with path "/package_id/drive", gives you read and write caps.
/// Will only work on the same package_id as you're calling it from, unless you
/// have root capabilities.
Expand Down

0 comments on commit e84d1dc

Please sign in to comment.