Mostly @rude
When I try to save a binary file all goes well, strings are as long as they should be, but when I call love.filesystem.write it just stops at the first NULL character ("\0"). Something I can do to prevent this?
EDIT:
SWIG manual wrote:
The char * datatype is handled as a NULL-terminated ASCII string. SWIG maps this into a 8-bit character string in the target scripting language. SWIG converts character strings in the target language to NULL terminated strings before passing them into C/C++. The default handling of these strings does not allow them to have embedded NULL bytes. Therefore, the char * datatype is not generally suitable for passing binary data. However, it is possible to change this behavior by defining a SWIG typemap. See the chapter on Typemaps for details about this.
Do you have any backslashes (\) in your strings? That usually does some weird things if you mean for it to show up as a backslash, because particular backslash and character combinations make special characters (i.e. \n makes a new line). If you want to input a backslash, type '\\' instead of just '\'.
Also, here's a list of other special backslash characters if you need them:
\a bell
\b back space
\f form feed
\n newline
\r carriage return
\t horizontal tab
\v vertical tab
\\ backslash
\" double quote
\' single quote
\[ left square bracket
\] right square bracket
Working on: Viator
Need a 64-bit Debian package for LÖVE? Here it is!
Sorry, I'm not that agressive on the forums these days. (But your bump worked). There's probably nothing you can do about that at this point. I didn't know SWIG did that.
FYI, I checked up on this:
lua.org wrote:
lua_tolstring returns a fully aligned pointer to a string inside the Lua state. This string always has a zero ('\0') after its last character (as in C), but can contain other zeros in its body. Because Lua has garbage collection, there is no guarantee that the pointer returned by lua_tolstring will be valid after the corresponding value is removed from the stack.
SWIG has been removed, so I guess this problem is already fixed (in SVN, that is). I'll add it to the "test me"-list. As for a temporary fix: stop needing binary data.
Again @rude
love.filesystem.mkdir doesn't work, and because I can't find an mkdir in standard Lua (I could swear I've used something like that), it'd be nice if I knew the correct syntax.