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 13:16:37 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <56eff4a4$0$4238$e4fe514c@news.kpn.nl> 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: 8bit 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:29879 Date: 2016-03-24T13:16:37+01:00 List-Id: On 2016-03-24 11:41, G.B. wrote: > On 24.03.16 09:00, Dmitry A. Kazakov wrote: >> The mapping is normally predefined. E.g. when you run MinGW, Windows >> roots are already mapped: >> >> E:\ -> /e/ > > Enter a microcontroller with both a flash drive attached and > some other storage connected via network. Not much of > an operating system, yet a simple, single-threaded hierarchical > file system for the flash drive. > > Then, when porting a prototype version of a program from > Windows™ to the controller, I thought that the programmer, > or "operator", should be able to instruct the run-time that > > - "E:\" should be mapped to something that represents the "root" > of the filesystem on the flash drive, and > > - %HOMEDRIVE% be mapped to the network attached thing, > > - %HOMEPATH% to below what %HOMEDRIVE% has become. OS user (operator), yes, programmer, as Ada programmer, no. Configuring the system environment is not the objective of the program. An Ada program deals with the existing environment. So basically it is not Ada standard library concern. It will have a "home directory" path generator function, implemented somehow. Thus the programmer will be able to express "hello_world Ada body file from home directory" in a system-independent way. > If the program was developed without many features required > of the file system, then the source text that names files > would not need to be recompiled by any configurable implementation > of Ada. Yes, because file systems have similar properties expressed differently when paths are strings. That is why path must be a proper type instead. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de