Add an empty directory to tracking explicitly. This is distinct from `add_to_tree` because it specifically handles empty directories that need to be tracked even without children. The directory will be marked with `DIR_EXPLICIT | DIR_EMPTY` flags. # Arguments `txn` - A mutable transaction `path` - The normalized directory path # Returns The allocated inode for the directory. # Example ```ru
(txn: &mut T, path: &str)
| 79 | /// txn.commit()?; |
| 80 | /// ``` |
| 81 | pub fn add_directory_to_tree<T: MutTxnT>(txn: &mut T, path: &str) -> TrackingResult<Inode> { |
| 82 | // Allocate a new inode |
| 83 | let inode = txn |
| 84 | .alloc_inode() |
| 85 | .map_err(|e| TrackingError::Database(e.to_string()))?; |
| 86 | |
| 87 | // Add to tree tables |
| 88 | txn.put_tree(path, inode) |
| 89 | .map_err(|e| TrackingError::Database(e.to_string()))?; |
| 90 | |
| 91 | // Mark as an explicit empty directory |
| 92 | txn.put_directory(inode, directory_flags::explicit_empty()) |
| 93 | .map_err(|e| TrackingError::Database(e.to_string()))?; |
| 94 | |
| 95 | Ok(inode) |
| 96 | } |
| 97 | |
| 98 | /// Check if an inode represents a directory. |
| 99 | /// |
no test coverage detected