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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3accd44abeec75ee X-Google-Attributes: gid103376,public From: jerry@jvdsys.stuyts.nl Subject: Re: DOS/Win95 file names Date: 1999/06/13 Message-ID: #1/1 X-Deja-AN: 489056083 Sender: jerry@stuyts.nl (Jerry van Dijk) References: <375fd4b4.608956077@news.dsuper.net> <3762e49c.109413162@news.dsuper.net> Organization: * JerryWare HQ *, Leiden, Holland User-Agent: tin/pre-1.4-980226 (UNIX) (Linux/2.2.9 (i586)) Newsgroups: comp.lang.ada Date: 1999-06-13T00:00:00+00:00 List-Id: 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