comp.lang.ada
 help / color / mirror / Atom feed
From: jerry@jvdsys.stuyts.nl
Subject: Re: DOS/Win95 file names
Date: 1999/06/13
Date: 1999-06-13T00:00:00+00:00	[thread overview]
Message-ID: <FD9Hv7.8J@stuyts.nl> (raw)
In-Reply-To: 3762e49c.109413162@news.dsuper.net

fluffy_pop@dsuper.net wrote:

: '?' is not allowed under either DOS or Windows in a file name.  I have
: a procedure that checks this.  That's my point.  My procedure doesn't
: work right.  It validates correctly all the other conditions (those
: I outlined above) except for the illegal charcter like '?'.  The point
: of the validation is to prevent the program to reach the point where
: it tries to create a file with a name that contains one or more
: illegal characters.  In my validation procedure I sweep through a 
: string containing the illegal characters, for each character of the
: file name.  For some reason the '?' in the file name entered does
: not get caught, as if it were not Alt+063.

Ok, so the problem is that the algorithm (or implementation) you
use for checking for invalid characters does not work as it is supposed
too. It is difficult to say what is wrong with it, without seeing some
actual code.

I guess you use something like:

   with Ada.Strings.Fixed; use Ada.Strings.Fixed;

   function Has_Invalid_Char (S : String) return Boolean is
      Illegal_Characters : constant String := "&?|\/:""";
   begin
      for I in S'Range loop
         if Index (Illegal_Characters, S(I .. I)) /= 0 then
            return True;
         end if;
      end loop;
      return False;
   end Has_Invalid_Char;

-- 
-- Jerry van Dijk | Leiden, Holland
-- Team Ada       | jdijk@acm.org
-- see http://stad.dsl.nl/~jvandyk




  reply	other threads:[~1999-06-13  0:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-10  0:00 DOS/Win95 file names fluffy_pop
1999-06-11  0:00 ` Gautier
1999-06-11  0:00   ` Pascal Obry
1999-06-11  0:00   ` fluffy_pop
1999-06-11  0:00     ` dennison
1999-06-11  0:00       ` Robert Dewar
1999-06-11  0:00       ` fluffy_pop
1999-06-12  0:00         ` Robert Dewar
1999-06-12  0:00 ` jerry
1999-06-12  0:00   ` Mario Klebsch
1999-06-12  0:00     ` fluffy_pop
1999-06-12  0:00   ` fluffy_pop
1999-06-13  0:00     ` jerry [this message]
1999-06-13  0:00       ` fluffy_puff
1999-06-13  0:00         ` Matthew Heaney
1999-06-14  0:00           ` fluffy_puff
1999-06-14  0:00           ` fluffy_puff
1999-06-13  0:00     ` fluffy_puff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox