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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f890526de6a8a218 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: How to detect OS type and version? Date: 16 Oct 2005 11:55:05 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <20051013115001.60b6a695@pscube.informatik.uni-stuttgart.de> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1129478105 5457 192.74.137.71 (16 Oct 2005 15:55:05 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sun, 16 Oct 2005 15:55:05 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:5725 Date: 2005-10-16T11:55:05-04:00 List-Id: Kilgallen@SpamCop.net (Larry Kilgallen) writes: > In article , Ray Blaak writes: > > Robert A Duff writes: > >> Ray Blaak writes: > >> > Simply adding a new OS to some central definition should not impact all > >> > existing code. In practical terms people should have had an "unknown OS" > >> > handler anyway. > >> > >> What is the directory separator character on "unknown OS"? ;-) > > > > I don't know, of course. The point is to have a plan for it. In the worst > > case you exit with the appropriate error message "unknown OS!". In practice > > you assume "Unix". > > I got to work on some Ada code that used this "directory separator" > approach. Perhaps it is ok if your only choices are Windows or Unix, > but on VMS the characters ":[", "." and "]" are all used, except when > that list is ":<", "." and ">". Needless to say, the "directory separator" > approach was totally inadequate. Yes, I agree. What you want is a set of operations for pulling apart pathnames and putting them together in various ways. Even that won't work on some systems, but I suspect it's good enough in practise. Ada 2005 has something along those lines, but I haven't looked at it carefully. So perhaps I should have said, "What is the algorithm for parsing file names on `unknown OS'?" ;-) - Bob