lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On 14/08/2022 04:23, Ryan Starrett wrote:
Typo in title, os.remove & os.rename.

I guess because they not only are platform-dependent but also OS-dependent: there are platforms in which there is no file system where those operations would make no sense, whereas those in io library could still be performed. Don't make the names fool you: Lua I/O model follows strictly that of C, in which a file is not an actual filesystem file, but it's an abstract entity (defined in the C standard).

So, for example, you could have an embedded system with no file-system, but still you could have a C "FILE" represent an I/O channel over, say, an SPI or USART interface.

My 2 cents.

-- Lorenzo



On Sat, Aug 13, 2022 at 10:22 PM Ryan Starrett <pyryanggg@gmail.com> wrote:

This confused me. The only reason I could think would be that their
behavior is very platform dependent, but that's also true for IO functions.
Why are these functions in OS instead of IO?