Closed magicant closed 1 month ago
The recent updates to the yash-env
project significantly enhance the system
module by introducing new types and methods that improve file handling and metadata representation. Key changes include the introduction of FileType
and Stat
, updates to existing methods for better clarity, and a shift away from older types like FileStat
. These enhancements streamline interactions with system-level operations, promoting ease of use and maintaining a cohesive interface.
Files | Change Summary |
---|---|
yash-env/src/system.rs |
Expanded System trait with new methods; updated return types from FileStat to Stat ; added intuitive constants for Mode . |
yash-env/src/pwd.rs |
Removed same_files function, now utilizing identity() method for file comparison. |
yash-env/src/system/file_system.rs |
Introduced FileType enum and Stat struct for clearer file type handling and improved metadata structure. |
yash-env/src/system/real.rs |
Updated fstat and fstatat methods to return Stat , with changes to enhance safety using MaybeUninit . |
yash-env/src/system/shared.rs |
Modified fstat and fstatat methods to return Stat , ensuring consistency across system implementations. |
yash-env/src/system/virtual.rs |
Removed stat function; methods now return Stat directly, simplifying metadata retrieval. |
yash-env/src/system/virtual/file_system.rs |
Added stat method to INode and type /size methods to FileBody for better metadata access. |
yash-semantics/src/redir.rs |
Simplified file type checks in open_file_noclobber , replacing bitwise operations with FileType checks for improved readability. |
sequenceDiagram
participant User
participant System
participant FileType
participant Stat
User->>System: Request file status
System->>FileType: Determine file type
FileType-->>System: Return file type
System->>Stat: Retrieve file metadata
Stat-->>System: Return file metadata
System-->>User: Provide file status
π In a world of files, both big and small,
The changes we bring will help one and all.
With types that are clear and methods that shine,
Every rabbit coder will save precious time!
Happy coding, my friends, letβs hop with delight,
As we build up our tools to new heights! πΎβ¨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This is part of #353. The
FileStat
andSFlag
are removed in favor of the newStat
type.Summary by CodeRabbit
New Features
FileType
enum andStat
struct for enhanced file management.INode
andFileBody
.Bug Fixes
Refactor
System
trait to return a newStat
type instead of the previousFileStat
.Chores