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 X-Google-Thread: 103376,3accd44abeec75ee,start X-Google-Attributes: gid103376,public From: fluffy_pop@dsuper.net Subject: DOS/Win95 file names Date: 1999/06/10 Message-ID: <375fd4b4.608956077@news.dsuper.net>#1/1 X-Deja-AN: 487980375 Content-Transfer-Encoding: 8bit X-Original-NNTP-Posting-Host: asc8-addr-100.dsuper.net Content-Type: text/plain; charset=ISO-8859-1 X-Trace: 10 Jun 1999 13:13:57 -0400, delphi.dsuper.net Organization: via Internet Direct MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-06-10T00:00:00+00:00 List-Id: Hi, I'm a student writing a program that must ask the user for a file name to be either created for writing or opened for reading by the program. I'm being asked to validate the name format so that it satisfies the (8.3) DOS requirements (actually it's a hybrid because I'm accepting characters illegal under DOS but legal under Windows). It's a Ada console program and I'm working on a Win95 machine. 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. The file *is* there. Also, when the file name contains a '?', my program crashes (when what follows is a Create(F,Out_File,"name") ). That's because the sweep of the string containing the illegal characters, in my validation procedure, is not working properly. The name passes through whithout the illegal character being detected. Everything else about the validation works fine. So the value of each character entered in the file name by the user does not match the value of the characters in the actual Windows/DOS file names, or the value of my own program's string of illegal characters (a constant). That string is declared like this: ILLEGAL_CHAR : CONSTANT string := "*?|\/<>:"""; Now, I'm guessing that the character code that is actually put on my Ada page ("my_prog.ada") in that string matches the code of the characters of the real file names, since I'm working under Windows when I write my program code and the files are created also under Windows or DOS. Also, I'm assuming that when the user enters let's say '�', what is put in the string to hold the file name in my program is determined by the active Windows character table/code. I think that it matches exactly or very closely the ISO 8859-1 standard, which in turn fits with Ada.Characters.Latin_1. For my DOS, currently, it's 850 Multilingual (Latin I). I have these tables to look up. Beyond that I don't know much. I know how to use the DOS Alt+x[xx] codes, and the Windows(?) Alt+0x[xx] codes for display, but I don't know the character(s) produced that go just before the numerical code. I don't know exactly what produces this/these special characters or what their role is in terms of what part of the system uses them: hardware and/or OS, and/or my program. Anyway, this might have nothing to do whith my problem, but I would still like to have some hint. Thanks Marc Galipeau -- What I really am is "fluffy", no "_dong", no "_puff", no "_woo", no nothing, just plain fluffy.