On Wed, 20 Oct 1999 11:40:46 -0400 (EDT), [EMAIL PROTECTED] wrote:
>
>Hi, All!
>
>I have generic question:
>Is there any PLATFORM_INDEPENDENT way to test if given String defines a valid
>file name without actually trying to create the file. I want to perfom such
>test in the KeyEvent handler and attempting to create file every time doesn't
>sound good to me.
There is no good way to do this. However, you may need to rethink
your plan of having this done in the key event handler. It is possible
to have a filename string that will go though an invalid state before
becoming a valid name.
The easiest way to know that you are "valid" is to limit the name to
alpha-numeric (A-Z,0-9) characters and a single "."
(Even worse, 8.3 for DOS systems but most things are beyond that)
There may be a way to create a file object (which is not the same as
creating the file) but that may not provide the final check for you.
--
Michael Sinz ---- Technology and Engineering Director/Consultant
"Starting Startups" mailto:[EMAIL PROTECTED]
My place on the web ---> http://www.users.fast.net/~michael_sinz
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]