Squirrel provides Squirrel Standard Library (http://www.squirrel-lang.org/squirreldoc/stdlib/index.html) that enables us to use basic I/O, string and math functions. However, these need a registration in the C++ code to use them in a squirrel code. For example, the I/O library needs the execution of sqstd_register_iolib (http://www.squirrel-lang.org/squirreldoc/stdlib/stdiolib.html#c.sqstd_register_iolib). Current simutrans does not seem to do this routine and the Standard Library is unavailable.
It would be useful if I can use the Standard Library in squirrel code. Is there any reason not to support them in Simutrans?
Parts of this lib are used: math, string, and system. I did not see a reason to also register the other parts. Why do want to use this?
Quotethe I/O library
Open I/O, open a security problem. You can read and write files on the PC of the player. Maybe you want read some information from file in a script.
But this can be miss used too.
Yes, I want to use the I/O library to extract some information of games as a file and use them with external programs, only with squirrel scripts. However, I have to admit that supporting I/O brings a security problem as makie put it.
One could force the files to be limtied to the simutrans directory by forbidding any path characters like /\:,; or so.