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-Language: ENGLISH,ASCII Path: g2news2.google.com!news2.google.com!news.glorb.com!news2.glorb.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Ada.Directories.Base_Name and dot files References: <4acc8c20$0$284$14726298@news.sunsite.dk> From: Stephen Leake Date: Thu, 08 Oct 2009 05:39:00 -0400 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) Cancel-Lock: sha1:xozBZHSarVYO8TTcNjBKirj7ZdE= MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 1b4434acdb338e197caa724453 Xref: g2news2.google.com comp.lang.ada:8621 Date: 2009-10-08T05:39:00-04:00 List-Id: Thomas L�cke <"tl at ada-dk.org"> writes: > begin > IO.Put_Line (Item => "1: " & D.Base_Name (Name => "foo.txt")); > IO.Put_Line (Item => "2: " & D.Base_Name (Name => ".foo")); > IO.Put_Line (Item => "3: " & D.Base_Name (Name => ".foo.bar")); > end Dot; > ++++ > > The output I get is this: > > ++++ > 1: foo > 2: > 3: .foo > ++++ > > What I had hoped for, was this: > > ++++ > 1: foo > 2: .foo > 3: .foo > ++++ Just out of curiosity, what made you hope for this? The Gnu coreutils basename function doesn't do what you want, either: $ basename foo.txt foo.txt $ basename foo.txt .txt foo $ basename .foo .foo $ basename .foo .foo .foo $ basename .foo.bar .foo.bar $ basename .foo.bar .bar .foo $ basename .foo.bar .foo .foo.bar $ basename .foo.bar .foo.bar .foo.bar > With the current null string solution, you'd have to do some manual > parsing to get to the actual basename of a dot file. What is your definition of "the actual basename"? > Is there a good reason for the current behavior? It's well-defined. And it does what I want :). -- -- Stephe