nfengine
nfengine copied to clipboard
Design and implement custom class to handle files
Currently our project uses FILE struct from C as a contact point with files in the system. While this is a multi-platform solution, it may not be the fastest and we don't have much control over its internals. We need our own, custom module to handle files.
Basic features to do:
- [x] Basic file operations (create/remove/copy/move). Make sure to keep these calls as optimized as possible.
- [x] Support for files greater than 4GB.
- [x] Communication with files by read/write calls
- [x] Communication with files by NFE::Common::InputStream and NFE::Common::OutputStream.
- [x] Iterators for going over files - one iterator to go through all files in single directory, one to traverse recursively all files inside a directory together with sub-dirs.
- [ ] Paths manipulations: joining paths, extracting file name, parent directory name, extension, etc.
Advanced features to do:
- [x] Monitoring for a file/directory modification (allowing to register a function called when a file or a directory content is modified).
- [ ] Memory-mapped files.
- [ ] Setting I/O priority per file.
All features should work with system-dependent calls. This means, such class must be prepared for multi-platform use.
All features should be tested in nfCommonTest, especially for some unique situations.
First two commits introducing FileSystem and File classes: https://review.gerrithub.io/#/c/217602/ https://review.gerrithub.io/#/c/217603/