Enumerate files outside of root / save directory, recursively

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Enumerate files outside of root / save directory, recursively

Post by zorg »

pgimeno wrote: Fri Feb 16, 2018 3:18 pm
zorg wrote: Fri Feb 16, 2018 12:05 pmIf this only happens because you tried to do ffi.load("love") then you missed the fact that on linux, you don't do that.
I was just objecting to coffeecat's proposal to always load love:
coffeecat wrote: Fri Feb 16, 2018 3:08 amThis semantics is probably related to the fact that "Windows symbols are bound to a specific DLL name", while symbols in POSIX systems aren't.

I think the best practice is to always use ffi.load("love"). It's an already loaded dynamic library, and each dynamic library is loaded at most one time for one executable. Therefore ffi.load("love") does no actual loading.
Ah, in that case, you are right, but...
pgimeno wrote: Fri Feb 16, 2018 3:18 pm The best thing to do may be to pcall ffi.C.PHYSFS_mount and try to load love only if that fails.
...I still disagree with this one; the snippet i reposted should fix all problems without needing to call ffi.C.PhysFS_mount more than once and check whether it failed.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: Enumerate files outside of root / save directory, recursively

Post by pgimeno »

zorg wrote: Fri Feb 16, 2018 5:15 pm...I still disagree with this one; the snippet i reposted should fix all problems without needing to call ffi.C.PhysFS_mount more than once and check whether it failed.
... assuming the Windows version is not statically linked like my Linux versions are.

I didn't suggest calling it, just trying to access the symbol, i.e. something like: ok = pcall(function() return ffi.C.PHYSFS_mount end)

Edit: But again, that's the second-best option. The best option would be for the engine's love.filesystem.mount to not block any directories in the first place.
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Enumerate files outside of root / save directory, recursively

Post by zorg »

pgimeno wrote: Fri Feb 16, 2018 5:38 pm
zorg wrote: Fri Feb 16, 2018 5:15 pm...I still disagree with this one; the snippet i reposted should fix all problems without needing to call ffi.C.PhysFS_mount more than once and check whether it failed.
... assuming the Windows version is not statically linked like my Linux versions are.

I didn't suggest calling it, just trying to access the symbol, i.e. something like: ok = pcall(function() return ffi.C.PHYSFS_mount end)

Edit: But again, that's the second-best option. The best option would be for the engine's love.filesystem.mount to not block any directories in the first place.
I can understand the safety checks, but yes, it does make me need to redefine löve functions i wouldn't want to touch if i wanted to circumvent the limits.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 58 guests