gametechmods

Robot Arena => Discussion => Topic started by: Stagfish on February 16, 2010, 11:50:51 AM

Title: strange
Post by: Stagfish on February 16, 2010, 11:50:51 AM
if you put :D at the end of a exported robots name or a custom texture this happens
 
(https://gametechmods.com/uploads/images/70527wmplayer 2010-02-16 17-47-52-61.png)
so dont get to worked up about files not working people
Title: Re: strange
Post by: G.K. on February 16, 2010, 11:51:36 AM
Hi Jack.
Title: Re: strange
Post by: Stagfish on February 16, 2010, 11:51:53 AM
hi
Title: Re: strange
Post by: Trovaner on February 16, 2010, 12:11:14 PM
In windows, file names may not contain any of these forbidden characters: \ / : * ? " < > |
(To my understanding, Mac and Linux have similar restrictions on names)

If you try to export something with any of these in the file name, the game will stop transferring data into the file as soon as it gets an error (resulting in 0 byte files with names that have everything up until the forbidden character).
Title: Re: strange
Post by: Serge on February 16, 2010, 12:57:36 PM
You know what's awesome? Try to create a file called con.txt on windows. Or con.anyextension for that matter.

That's boilerplate for compability with DOS application in times there were no folders (every file was stored in the same root catalogue on the disk). Why? Because such files (CON, COM1, LPT1, etc) were files through which programs could access i/o ports of a computer. When DOS evolved to get folders, it had to "emulate" those magic files in every folder, to retain compability with older applications. That's right kids, Windows 7 has still some code left from DOS 1.0.
This is why boilerplate makes Windows suck. Microsoft needs to get over old sh** and create a totally new operating system, like Apple did with OS X. You will lose compability with older software, but what the heck, this sort of sh** IS annoying.


Back on topic. I am surprised RA2 doesn't crash when you try to export something with : in it's name. CreateFile() (http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx) returns INVALID_HANDLE_VALUE on error, so WinAPI functions to write to a file should (in theory) throw an exception when trying to access a NULL file, which in turn isn't handled by RA2 (otherwise it'd make a nice dialog "cant' save to file you suck blablabla"), and would make the C++ runtime freak out and terminate the program.
WinAPI is one curious beast.