[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why are os.remove and os.remove in the OS library instead of the IO library?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 22 Aug 2022 10:02:19 -0300
> 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).
That's right. More precisely, the I/O library handles what C calls
"streams", while both os.remove and os.rename are operations on the
file system.
-- Roberto