Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Malcolm McLean Newsgroups: comp.lang.c Subject: Re: "undefined behavior"? Date: Fri, 14 Jun 2024 20:13:33 +0100 Organization: A noiseless patient Spider Lines: 36 Message-ID: References: <666a095a$0$952$882e4bbb@reader.netnews.com> <8t3k6j5ikf5mvimvksv2t91gbt11ljdfgb@4ax.com> <666a18de$0$958$882e4bbb@reader.netnews.com> <87y1796bfn.fsf@nosuchdomain.example.com> <666a2a30$0$952$882e4bbb@reader.netnews.com> <87tthx65qu.fsf@nosuchdomain.example.com> <87o784xusf.fsf@bsb.me.uk> <87ikybycj6.fsf@bsb.me.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 14 Jun 2024 21:13:34 +0200 (CEST) Injection-Info: dont-email.me; posting-host="a1a1f0f0ac20762b9989d6d76f6da271"; logging-data="3175079"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19vlpxuePDEk/hPykByeR7E/YkyvbTk8oE=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:6/erPnSqiG1kyNvI/wBny6ROZ1g= Content-Language: en-GB In-Reply-To: Bytes: 3286 On 14/06/2024 19:31, bart wrote: > On 14/06/2024 19:06, Malcolm McLean wrote: >>    Baby X FS - the filing system - code that allows you to create a >> virtual drive on your computer and access files from it using special >> fopen(), fclose() functions, but standard library functions like >> fprintf() or fgetc() for the other operations > > I think people don't get is why they should use this filing system, when > they already have a perfectly good one within their OS on which fopen() > etc already work. > > When you do fclose() after writing a file, will get it written to some > persistent media? > > Because either it says in memory (dangerous if your machine crashes, or > someone just turns it off), or it gets written to the same SSD/SD/HDD > media that the real OS uses. In which case, what is the point? > > I gather this is not any of kind of OS with its own drivers for the > peripherals on the machine, that takes over the real OS, or runs as some > kind of virtual machine. > The main use is intended to be as a read-only internal drive containing resources. But the interface also supports opening files in write mode, and they are held in memory. In the case of an application with FileSystem XML embedded as a string, the files will revert to the original on program termination - there's no sensible way of altering an embedded internal string at run time. In the case of programs which supply the FileStstem XML file in a configuation file, the filesystem has a function caled bbx_fs_dump() whch writes its entire state to disk as a FileSystem XML file. -- Check out my hobby project. http://malcolmmclean.github.io/babyxrc