comp.lang.ada
 help / color / mirror / Atom feed
From: fluffy_pop@dsuper.net
Subject: DOS/Win95 file names
Date: 1999/06/10
Date: 1999-06-10T00:00:00+00:00	[thread overview]
Message-ID: <375fd4b4.608956077@news.dsuper.net> (raw)

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.






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

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

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