Hacker News new | ask | show | jobs
by shimodateakira 670 days ago
Hello, this is Akira. Thank you for your comment.

The idea of using VirtualStorage<T, U> is very interesting. Currently, the class representing a directory is of the VirtualDirectory type, which is not a generic type. I think the idea of making directories a generic type, VirtualDirectory<U>, to encapsulate a user-defined type U, similar to how VirtualItem<T> represents items, is very useful. Consequently, it would allow us to comprehensively manage everything as VirtualStorage<T, U>.

With your proposed approach, when using VirtualStorageLibrary to represent a file system in memory, it would be possible to create an instance of VirtualStorage<T, U>. This would intuitively allow for the retention of information about physical files and directories.

The key feature of this use case is that it allows for efficient reference and traversal of nodes in a file system maintained with VirtualStorage<T, U> through the VirtualStorageLibrary API. However, implementing node operations (deletion, moving, copying) presents some challenges. This is because, when performing node operations, it is necessary to update the System.IO.DirectoryInfo held within VirtualDirectory<U>. This implies that there would be overlapping node operations between the node manipulations in VirtualStorageLibrary and those in System.IO. Given this, it seems more practical to focus solely on efficient node referencing and traversal in this use case.

The idea of associating a third type with VirtualSymbolicLink in VirtualStorageLibrary might require further consideration, but it certainly seems worth exploring.

Thank you for sharing such meaningful and interesting ideas. If you would like, please consider posting your ideas in the issues or discussions on the VirtualStorageLibrary repository.

VirtualStorageLibrary GitHub: https://github.com/shimodateakira/VirtualStorageLibrary