From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Operating System differences and Ada OS independent programming Date: Thu, 24 Mar 2016 08:58:01 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <56eff4a4$0$4238$e4fe514c@news.kpn.nl> <47928e41-a04b-46fb-a5cc-3a3451e0246e@googlegroups.com> NNTP-Posting-Host: LMk7+sG0YqgPmReI4fVkAA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:29874 Date: 2016-03-24T08:58:01+01:00 List-Id: On 2016-03-24 04:36, Shark8 wrote: > On Wednesday, March 23, 2016 at 2:39:08 AM UTC-6, Dmitry A. Kazakov wrote: >> >> Ada's abstraction should reflect the most generic file system properties: >> >> - Acyclic directed graph of names built from Unicode code points; > > No, these should be a private type which is 0..Unsigned_32/64 and > has the name as a property whose value is a unicode string. There should be > a "translate" function which takes a Unicode string and translates it > into the filesystem-actual's encoding. -- an identical yet distinct type > should exist for directories. Ada does not have Unicode strings. The point is that graph nodes (filenames) are logically chains of code points. >> - Multiple roots (AKA devices); > > No, absolutely not. Why? Only one OS (Unix) has single root, which does not work anyway in presence of networking, virtual, portable file systems. In its GUI, e.g. GNOME Linux dropped single root concept. >> - Current directory path generator; > > Pretty much unneeded if there's a directory-type: > Type FS_Rider is > Current : Directory_Type; > -- Other state information. > end record; You need functions returning standard paths. E.g. (imaginary operations) Get_Current_Directory / "My_Folder" / "Hello_World" + "ads" instead of "./My_Folder/Hello_World.ads" >> - Extension / MIME types; > > Why? Files have extensions, don't they? >> - Version / change / release number; > > Definitely. > >> - Time stamps (modification, creation etc). > > Which should be Ada.Calendar.Time. Yes, but you need operations putting them into the path. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de