3 ms·
Why is opening file in "os" namespace but closing file in "io" namespace?
by dvh 5y ago
Why is opening file in "os" namespace but closing file in "io" namespace?
- ddevault 5y agoThe I/O namespace provides an I/O abstraction that only knows about I/O operations, like read and write, rather than I/O objects. https://docs.harelang.org/io https://docs.harelang.org/io There's also an "fs" module which provides a filesystem abstraction: https://docs.harelang.org/fs https://docs.harelang.org/fs The "os" module links these with the host operating system. It provides an implementation of the fs abstraction for the current working directory in the host filesystem, and also provides convenience wrappers like os::open, which calls fs::open with the host filesystem singleton. https://docs.harelang.org/os#open https://docs.harelang.org/os#open