Sujet : Re: encapsulating directory operations
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 21. May 2025, 20:31:13
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250521121507.235@kylheku.com>
References : 1 2 3 4 5 6 7 8 9
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2025-05-21, Paul Edwards <
mutazilah@gmail.com> wrote:
I don't need an official endorsement. What I need to know
is that you can't think of any philosophical reason that the
C90 committee shouldn't have done that - had they chosen
to do so.
That's like a double recursion: taking us into a subjunctive
derived from an unrealized past!
I think all the pieces are in the discussion until now to identify why
it would have been a bad idea for C90 to try to provide directory
access. A one-size fits all solution could easily have low fidelity for
real programs whose users demand detailed platform integration, or else
it could be a mess full of options and details that try to cover every
system, but don't make sense on most of them.
Common Lisp's pathnames are a good example of the latter. It's a
complicated feature which has details that map to exotic filesystems
that are no longer in use. MOreover, different implementations of
Common Lisp for the same host systems vary in how they map certain
details of pathname objects to the host operating system. For instance
given the suffix .tar.gz on POSIX, one pathname implementations might
treat just the "gz" as a the type attribute, whereas another might treat
"tar.gz" as the type attribute.
I think that if you're making some self-contained solution that must
havce a hierarchical file system, and has to be in C90, then just
code up a filesystem that exists entirely within one file that
you can open for updating in binary mode using fopen("....", "r+b")
and within which you create all the needed structure.
Then you need not have a shred of anything system-specific
in your file code.
As an almost completely separate project, you could write a FUSE
(filesystem in user space) module for Linux that would allow users to
mount your filesystem image. This way images could be manipulated by
something other than your software, which could come in handy.
If you impelment an existing filesystem (like FAT32 or whatever)
then that works is already done. Given a file containing a FAT32
image, you can mount that on existing operating systems.
That could help you in your development.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca