Sujet : Re: encapsulating directory operations
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 23. May 2025, 01:44:27
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250522165011.52@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2025-05-22, Paul Edwards <
mutazilah@gmail.com> wrote:
"Kaz Kylheku" <643-408-1753@kylheku.com> wrote in message
news:20250522161342.990@kylheku.com...
>
On 2025-05-22, James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
On 5/22/25 18:46, Lawrence D'Oliveiro wrote:
On Thu, 22 May 2025 14:13:53 -0400, James Kuyper wrote:
>
POSIX wasn't universal when C90 came out, and it still isn't universal
today.
>
POSIX is very much universal today. The entire Internet runs on POSIX-
based systems. You likely have one in your pocket or purse right now.
>
POSIX systems are quite wide-spread today. That doesn't make them
universal. In order to be universal, there must be no non-POSIX systems,
and that is manifestly not the case. In particular, while there is
support for POSIX subsystem for Windows, it does not fully conform with
POSIX, and is not the default when using Windows. There's also systems
with no operating system at all, many of which could (and some of which
do) support a fully conforming implementation of C.
>
POSIX is fairly decently supported on Windows by Cygwin.
>
You can add anything to anything.
>
You may as well say that Windows is widely supported, via WINE.
In fact, WINE is jokingly known as the only stable system API on Linux.
I've made multiple attempts to install WINE. Only one of them,
years ago, worked. Yes, with enough work, I could likely have
got it to work.
I think, just use a distro where you just install it as a package?
Anyway, regarding Cygwin, I've never had problem getting that to
install on a Windows box.
I have a small project which is a fork of the Cygwin DLL,
which I call "Cygnal" (the project, not the DLL).
I use Cygwin's DLL as a run-time library for C programs on Windows,
which lets them use Windows as well as POSIX features.
However, Cygwin introduces certain translations in various
which make the environment look *too* POSIXy. I patched those
areas.
For instance, paths can have drivce letter names under the Cygnal
version of cygwin1.dll, like "c:/Program Files".
The POSIX function chdir() understands the "logged drive" DOS/Windows
concept. It associates drive letters with individual current
working directories, and all the path access, so that
open("e:foo.txt", O_RDWR) will open e:\path\to\foo.txt if
the cwd of e: is \path\to.
If you use system(), the interpreter is cmd.exe; whereas
the stock DLL will look for /bin/sh that doesn't exist
when you're just shipping a program DLLs.
Cygwin's PATH is colon-delimited, so it translates the Windows one. I
made it use the original semicolon delimited one.
Things like that.
POSIX is not universal. Not then. Not now. Unless you want
to DEFINE it that way. ie any non-POSIX machine "doesn't
count".
C90 also isn't universal. the fetch-decode-execute dcycle.
Alan Perlis Epigram 44:
"Sometimes I think the only universal in the computing field is the
fetch-execute cycle."
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca