Page 2 of 2

Re: File dialogs in Love2D?

Posted: Thu May 19, 2022 10:27 pm
by sarako
Fixed it by search-replacing "wchar_t" with "char" in nativefs.lua.

Re: File dialogs in Love2D?

Posted: Thu May 19, 2022 11:14 pm
by pgimeno
What do you need from nativefs that lovefs doesn't have? Yes, nativefs has pretty much the same API as love.filesystem, which is a plus, but I'm not sure it has any extended functionality with respect to lovefs. Using both sounds a bit like, for example, using two different JSON libraries to load two JSON files.

Re: File dialogs in Love2D?

Posted: Fri May 20, 2022 2:01 am
by sarako
I don't see any way to read/write files using lovefs besides sounds, fonts, and images. I'm using custom filetypes.

I'm also running into an issue where if I load a file after I've already loaded one, the program just closes without providing any errors. Any ideas why that might happen?

Here's what I have so far: https://github.com/zenzoa/roomie

Re: File dialogs in Love2D?

Posted: Fri May 20, 2022 10:15 am
by pgimeno
You can use the Lua io library for reading and writing files.

I have tried to load something but I can't reproduce the problem that you're having. Maybe provide a datafile that makes the program close?

Re: File dialogs in Love2D?

Posted: Fri May 20, 2022 2:04 pm
by sarako
Added test files to the repro. The steps to get it to crash: 1) create a new files, 2) open test.cos, 3) create a new file again, 4) open test.cos again. Thanks for checking!

In the meantime I'm converting my nativefs stuff to the lua io library. Totally forgot about that one. Thanks again!

Re: File dialogs in Love2D?

Posted: Fri May 20, 2022 2:22 pm
by sarako
Actually, after converting things to the lua io library, the crash has stopped happening. Not sure what made the difference, but seems to be working smoothly!