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: a07f3367d7,31af760e939556ef X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!news2.arglkargh.de!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Interpretation of extensions different from Unix/Linux? Date: Sun, 02 Aug 2009 19:13:18 +0200 Organization: Jacob Sparre Andersen Message-ID: References: NNTP-Posting-Host: 78.156.214.178.bredband.3.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: munin.nbi.dk 1249233263 15263 78.156.214.178 (2 Aug 2009 17:14:23 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sun, 2 Aug 2009 17:14:23 +0000 (UTC) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:qZlwKP5/RBGIdXC9iFdqfQlsCW4= Xref: g2news2.google.com comp.lang.ada:7530 Date: 2009-08-02T19:13:18+02:00 List-Id: Somebody wrote: > I noticed that the function Ada.Directories.Base_Name has a different > opinion about what a file name / extension is than my linux box: > > $ cat base_name_test.adb > with Ada.Text_Io; use Ada.Text_Io; > with Ada.Directories; use Ada.Directories; > > procedure Base_Name_Test is > begin > Put_Line ("Base_Name: " & Base_Name (".b")); > Put_Line ("Extension: " & Extension (".b")); > end Base_Name_Test; > > $ ./base_name_test > Base_Name: > Extension: b > > $ basename .b > .b > > Is there a reason for this difference? The specifications are different. The GNU basename command removes "any leading directory components". If _specified_, it will "also remove a trailing SUFFIX". Greetings, Jacob -- Infinite loop: n., see loop, infinite. Loop, infinite: n., see infinite loop.