I've been making a lot of threads about this lately but I reaaally want this to work.
I've attached a .love, all it does is place lfs.so in your save directory, then attempt to require it and use it to create a directory called TestDir.
For testing purposes, and since there's no console to print stuff to on Mac, I made it error "Success" if it managed to write a directory with no errors, otherwise, it outputs the error. I'd greatly appreciate if any mac users can just download and run this .love, and tell me what output you get.
Calling Mac users for a quick test!
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- OmarShehata
- Party member
- Posts: 259
- Joined: Tue May 29, 2012 6:46 pm
- Location: Egypt
- Contact:
Calling Mac users for a quick test!
- Attachments
-
- Mac LFS test.love
- (6.55 KiB) Downloaded 58 times
- slime
- Solid Snayke
- Posts: 3133
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Calling Mac users for a quick test!
It works, but only when the game is fused to love.app (it becomes fused when the .love is in the love.app/Contents/Resources/ folder, or if you pass --fused as a command-line option via the terminal.)
LÖVE's custom search path for Lua-C dynamic libraries only looks directly outside the game's save directory if it's unfused, otherwise it looks in the actual save dir.
LÖVE's custom search path for Lua-C dynamic libraries only looks directly outside the game's save directory if it's unfused, otherwise it looks in the actual save dir.
There is when running love through a terminal window, although most people probably won't do that.OmarShehata wrote:For testing purposes, and since there's no console to print stuff to on Mac
- OmarShehata
- Party member
- Posts: 259
- Joined: Tue May 29, 2012 6:46 pm
- Location: Egypt
- Contact:
Re: Calling Mac users for a quick test!
Ooohhh, if it's not fused, it doesn't actually look in the save directory, it looks outside of it. Now that I think about it, that is what bartbes mentioned in the other thread.slime wrote:It works, but only when the game is fused to love.app (it becomes fused when the .love is in the love.app/Contents/Resources/ folder, or if you pass --fused as a command-line option via the terminal.)
LÖVE's custom search path for Lua-C dynamic libraries only looks directly outside the game's save directory if it's unfused, otherwise it looks in the actual save dir.
Have you tested it fused or are we just talking theoretically? I wanted to know if it will actually create the directory or give me "Permission denied".
Also holy crap this is insanely useful. I've been throwing errors just to get output on Mac, thanks for the tip!There is when running love through a terminal window, although most people probably won't do that.OmarShehata wrote:For testing purposes, and since there's no console to print stuff to on Mac
- slime
- Solid Snayke
- Posts: 3133
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Calling Mac users for a quick test!
Yeah, I tested it unfused and it gave me "module 'lfs' not found", then I tested it with the "--fused" command line option and it gave me "main.lua:10: Success!!".OmarShehata wrote:Have you tested it fused or are we just talking theoretically? I wanted to know if it will actually create the directory or give me "Permission denied".
- OmarShehata
- Party member
- Posts: 259
- Joined: Tue May 29, 2012 6:46 pm
- Location: Egypt
- Contact:
Re: Calling Mac users for a quick test!
Ok, I'm having some trouble. I had some friends with Mac test it, by downloading the love.app from the home page, by tossing Mac LFS test.love inside the Contents/Resource, and double clicking the love.app, and they gotslime wrote:Yeah, I tested it unfused and it gave me "module 'lfs' not found", then I tested it with the "--fused" command line option and it gave me "main.lua:10: Success!!".OmarShehata wrote:Have you tested it fused or are we just talking theoretically? I wanted to know if it will actually create the directory or give me "Permission denied".
How come it worked for you? Any idea how a user can give love permission so that doesn't happen?
This is genuinely the only thing left for the launcher to work flawlessly on Mac. I'm not sure what to do if this doesn't work.
If you want a little more info on what exactly the launcher does, read on. If not, skip ahead.
=============================================================
The whole point is it hashes local files to compare against the files on the server, to download missing or update files.
The launcher is a .love, which downloads the files in the directory it's in. The game itself however, is a folder such that main.lua, conf.lua, Lib, Src etc.. are all in the root directory, and the love executable (whether love.exe or love.app) is inside that folder, and there is a file which runs this folder with the love executable (.bat on windows and .command on mac).
The reason the game is like that is to: One Make it easy for people to edit things such startup.ini, the levels directory, the Lib graphics assets, the errorlog.txt, etc.. And two to be able to read and write files in that directory from the game with Lua's i/o
We've gone through lots of changes to the structure and everything, and everything has its pro's and cons, but I'm just trying to get the most stable and streamlined form of distribution for everyone.
=============================================================
EDIT: Okay just tested having a friend open it with the method here http://www.wikihow.com/Open-Application ... s-on-a-Mac and it does give "Success" and does write the directory. But I'm not sure if it's really practical to ask all users to run it this way?
EDIT 2 Another friend tried it and it works for him without any permission crap. So this differs by computer/system?
- slime
- Solid Snayke
- Posts: 3133
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Calling Mac users for a quick test!
Yeah, programs (in general and on every OS, not just LÖVE and not just Mac OS X) need write permissions for the location they want to write to - in many cases if the folder being written to is in a user-specific location (e.g. the desktop or AppData), or if the user runs the program with Admin permissions, the program will be able to write there - otherwise it won't.
If you want consistency across systems (even the same OS) without the user having to do more work to get your game working, you should make sure your program only writes data to places where it will always have write permissions. AppData (and thus the game's save directory via love.filesystem) is the main place for programs in general to write data - that's one of the big reasons why it's the only writable directory with love.filesystem.
You could download the updated files as a zip (or .love), save them in the love.filesystem save directory, and use [wiki]love.filesystem.mount[/wiki] on the downloaded archive (or on an unzipped folder version of it) to make the game treat the files inside as if they were in the main .love or save directory.
You could also have a button ingame to open the save directory location directly in the user's file browser - this code demonstrates how.
Also, if the game is fused and you want read-only access via love.filesystem to files and folders in the same folder as your .love (or .exe in Windows), you can do this: love.filesystem.mount(love.filesystem.getSourceBaseDirectory(), mountpoint). That'll only work if the game is fused though.
If you want consistency across systems (even the same OS) without the user having to do more work to get your game working, you should make sure your program only writes data to places where it will always have write permissions. AppData (and thus the game's save directory via love.filesystem) is the main place for programs in general to write data - that's one of the big reasons why it's the only writable directory with love.filesystem.
You could download the updated files as a zip (or .love), save them in the love.filesystem save directory, and use [wiki]love.filesystem.mount[/wiki] on the downloaded archive (or on an unzipped folder version of it) to make the game treat the files inside as if they were in the main .love or save directory.
You could also have a button ingame to open the save directory location directly in the user's file browser - this code demonstrates how.
Also, if the game is fused and you want read-only access via love.filesystem to files and folders in the same folder as your .love (or .exe in Windows), you can do this: love.filesystem.mount(love.filesystem.getSourceBaseDirectory(), mountpoint). That'll only work if the game is fused though.
Who is online
Users browsing this forum: No registered users and 196 guests