Mark a directory as empty (no children). This is called when the last file is removed from a tracked directory. # Arguments `txn` - A mutable transaction `inode` - The directory's inode
(
txn: &mut T,
inode: Inode,
)
| 176 | /// * `txn` - A mutable transaction |
| 177 | /// * `inode` - The directory's inode |
| 178 | pub fn mark_directory_empty<T: MutTxnT + TreeTxnT>( |
| 179 | txn: &mut T, |
| 180 | inode: Inode, |
| 181 | ) -> TrackingResult<()> { |
| 182 | if let Some(flags) = txn |
| 183 | .get_directory_flags(inode) |
| 184 | .map_err(|e| TrackingError::Database(e.to_string()))? |
| 185 | { |
| 186 | // Add the DIR_EMPTY flag |
| 187 | let new_flags = flags | directory_flags::DIR_EMPTY; |
| 188 | if new_flags != flags { |
| 189 | txn.update_directory_flags(inode, new_flags) |
| 190 | .map_err(|e| TrackingError::Database(e.to_string()))?; |
| 191 | } |
| 192 | } |
| 193 | Ok(()) |
| 194 | } |
| 195 | |
| 196 | /// Remove a single file from tracking. |
| 197 | /// |
nothing calls this directly
no test coverage detected