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: fluffy_pop@dsuper.net Subject: Re: DOS/Win95 file names Date: 1999/06/12 Message-ID: <3762e49c.109413162@news.dsuper.net>#1/1 X-Deja-AN: 488926365 Content-Transfer-Encoding: 7bit References: <375fd4b4.608956077@news.dsuper.net> X-Original-NNTP-Posting-Host: asc-15-addr-223.dsuper.net Content-Type: text/plain; charset=us-ascii X-Trace: 12 Jun 1999 20:00:41 -0400, delphi.dsuper.net Organization: via Internet Direct MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-06-12T00:00:00+00:00 List-Id: On Sat, 12 Jun 1999 01:11:12 GMT, jerry@jvdsys.stuyts.nl wrote: >I do not quite follow this: > >a) the filename has to be consistent with DOS requirements, in which case >you should not accept filenames that are illegal under DOS, or > >b) you will be accepting Win32 filenames, but than there is not much sense >in restricting the name to 8.3. 1. more than 12 characters total => ERROR 2. more than 8 characters before the period => ERROR 3. more than one period => ERROR 4. no period => ERROR 5. illegal characters : those that are illegal under Windows only So it validates the name following DOS rules except for the illegal characters where it will allow '[', ']', '=', '+', ',', and ';'. >: As it is (my program), when the user enters a file name that contains >: an accented character, my handling of the Name_Error Exception occurs >: to produce a message that the file is not in the repertory. > >If I understand this correctly, you are saying that if a filename contains >a character, with an ASCII code > 127, you get a Name_Error exception when >you try to create/open it ? > >I presume you are not using UniCode or Wide_Character ? NO. >: Also, when the file name contains a '?', my program >: crashes (when what follows is a Create(F,Out_File,"name") ). > >Mmmm, would need to look this up, but in DOS terms, a '?' is a wildcard >character, and would cause problems when trying to create a file (or not >give you the file you expected when opening one). > >If you follow DOS rules, you should not allow a '?' in a filename. I'm not >sure if it is allowed under Win32 rules. '?' 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. I don't understand why because, like I said in one of my posts, '?' is within the ASCII 0-127 range, where the code is the same for DOS and for Windows. I thought that maybe there's something else about all this that I need to know. Marc -- What I really am is "fluffy", no "_dong", no "_puff", no "_woo", no nothing, just plain fluffy.