DevPinoy.org
A Filipino Developers Community
            

Attacked by reserved keywords

One of our shipment application are used by a number of countries.  It has a functionality to write files in an organized manner using country and gateway codes.  In other words, files for Manila gateway are written inside PH->MNL folder.

It has been used for years by our client and now a reported bug was raised when they used it for a gateway in some country with a gateway code of "PRN".  Ouch!

Among the reserved keywords are CON, AUX, COM1, COM2, COM3, COM4, LPT1, LPT2, LPT3, PRN, NUL.  The trivial reserved keywords spread months or years ago and for those who are still not aware, consult the kb here.


Posted Jul 18 2007, 07:05 PM by jokiz
Filed under: , ,

Comments

cruizer wrote re: Attacked by reserved keywords
on 07-18-2007 3:51 AM

oh no! so what's the solution then? program the class to catch the offending string (PRN) and replace it with another, harmless (to Windows) one?

Jon Limjap wrote re: Attacked by reserved keywords
on 07-18-2007 6:17 AM

Object name yan na PRN? Diba string lang naman yung gateway code...

cruizer wrote re: Attacked by reserved keywords
on 07-18-2007 7:17 AM

yes, and PRN is the directory name that's being created, which will fail.

jokiz wrote re: Attacked by reserved keywords
on 07-18-2007 8:40 AM

just prepend (tama ba word) the codes with underscore so no special handling for the keywords.

jd2001 wrote re: Attacked by reserved keywords
on 07-19-2007 1:24 PM
Posted a problem and commented a right answer. Unless when they come up with a reserved names with an underscore, probably in 10 years or never.
Ephedra. wrote Ephedra.
on 05-20-2008 1:19 AM

Ephedra.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?

Enter the numbers above:

Copyright DevPinoy 2005-2008
Powered by Community Server (Commercial Edition), by Telligent Systems