Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Valid filename
Message
 
To
09/03/2011 14:46:26
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
01502980
Message ID:
01503072
Views:
52
>And of course there is the remote possibility of serial (COM#) and parallel ports (LPT#) extending to more than the default number (e.g. I've run into situation where there was a COM25 serial port)...
>
>>>>I have a backup menu dan the client can create his own backup filename.
>>
>>I think NUL is missing from the list of no-nos.
>
>Of course one could claim that if you name your backup NUL, the backup will require ABSOLUTELY NO DISK SPACE!
>(of course the minor downside is that you won't be able to retrieve anything from such a backup...)

Reminds me of a retirement account..Upside - No taxes on the way in. Downside - no money on the way out.

>
>>
>>>This is what we use, is was from Chris Lange I think
>>>
>>>********************************************************************
>>>FUNCTION lValidFileName( tcFileName )
>>>********************************************************************
>>>  LOCAL lcValidChars, lcUpperJustFileName
>>>
>>>  m.lcValidChars        = " ^'@{}[],=()+._-!$%&/#~1234567890ABCEDFGHIJKLMONPQRSTUVWXYZ"
>>>  m.lcUpperJustFileName = UPPER( JUSTFNAME(m.tcFileName) )
>>>
>>>    DO CASE
>>>	CASE EMPTY( m.lcUpperJustFileName )
>>>		RETURN .F.
>>>	CASE INLIST( JUSTSTEM(m.lcUpperJustFileName), "AUX", "COM1", "COM2", "COM3", "COM4", "CON", "LPT1", "PRN" ) 
>>>		RETURN .F.
>>>	CASE LEN( CHRTRAN( m.lcUpperJustFileName, m.lcValidChars, "" ) ) > 0
>>>		RETURN .F.
>>>	OTHERWISE
>>>		RETURN .T.
>>>    ENDCASE
>>>
>>>ENDFUNC 
>>>
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Previous
Reply
Map
View

Click here to load this message in the networking platform