## LoveFS

Positive07
Party member
Posts: 1006
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

### Re: LoveFS

Thank you! That is nice I'll host it and let you know about it.
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(Github.com/Positive07)

Party member
Posts: 102
Joined: Fri Aug 29, 2014 6:05 pm
Location: France
Contact:

### Re: LoveFS

Hello ! I see that, on Windows, you got some trouble with spamming cmd~...
You can use kernel32.dll functions directly in Love2D using FFI library : http://luajit.org/ext_ffi.html (Love2D use LuaJIT which include FFI). But you need to setup the C part with all C datatype (BOOL, LPCTSTR, , _FILETIME, etc, etc...)

Use it like this :
kernel32.lua

Code: Select all

ffi = require "ffi"

kernel32 = {}

ffi.cdef [[

DWORD GetFileAttributesA (LPCTSTR path);
// More code~

]]

function kernel32:get_file_attributes (path)
return self._handle.GetFileAttributesA (path)
end

-- More code~

function file_exists (path)
local res = kernel32:get_file_attributes (path)

--if on W32 :
return res ~= -1 -- (0xffffffffffffffff)
-- if on W64 :
return res ~= 4294967295 -- (0x00000000ffffffff) Thanks Microsoft... ~
end

And you just need to do this for what you need !
You can do it also for POSIX system. But I think you don't need any "ffi.load" call
You done a great job, don't staph
Bye~

PS: I found this : https://github.com/stuta/Luajit-Tcp-Server Use "WTypes.lua" and "WinBase.lua" for all C types. But if you copy that, don't forget the credit
Founder of NeoShadow Studio. Currently working on the project "Sirami".

raingloom
Prole
Posts: 36
Joined: Wed Apr 22, 2015 12:35 am
Location: Always elsewhere

### Re: LoveFS

I get this error when running it on latest 64 bit Ubuntu with Löve from the official PPA:

Code: Select all

stack traceback:
[C]: in function 'ipairs'
lovefs/dialogs.lua:37: in function 'refresh'
main.lua:16: in function 'onclick'
loveframes/objects/button.lua:195: in function 'mousereleased'
loveframes/objects/base.lua:141: in function 'mousereleased'
loveframes/init.lua:267: in function 'mousereleased'
main.lua:76: in function <main.lua:75>
[string "boot.lua"]:433: in function <[string "boot.lua"]:413>
[C]: in function 'xpcall'


linux-man
Citizen
Posts: 67
Joined: Thu Apr 28, 2011 4:51 pm

### Re: LoveFS

It seems that os.execute() always return -1. This behaviour breaks the code since a successful execution should return 0.
This is probably due to the change to luajit and some compilation option in love 0.9.2. I would call it a bug.
I'll try to make lovefs work but right now I don't have any chance to test os.execute.

linux-man
Citizen
Posts: 67
Joined: Thu Apr 28, 2011 4:51 pm

### Re: LoveFS

At last 0.10.2 killed the os.execute() bug, BUT... since I've been away for so long, It was time to rewrite this library.
loveFS 1.0 drop console commands and embrace ffi, so it's now feasible to use it on Windows.
Also, the demo is made with Gspot.
Tested on Mint 64 bits and Windows 7 32 bits.
Thanks to Linkpy for showing me the way. You're the man!

pgimeno
Party member
Posts: 2408
Joined: Sun Oct 18, 2015 2:58 pm

### Re: LoveFS

Very nice library! At last a good alternative to the binary LuaFileSystem. I've sent a pull request for a fix related to having more than one window open (which shouldn't be possible).

File Systems are the most boring subject I can find, but, since I started a game editor in love (yet to come) I had some revolutionary ideas like loading images from somewhere...
I'm interested in that. I've been considering working on one since I first saw LÖVE. Specifically, a ZZT/MZX-style editor, with several ZZT/MZX-like preset tiles and effects. So I have to ask, what kind of game editor is that and what's its current status?

linux-man
Citizen
Posts: 67
Joined: Thu Apr 28, 2011 4:51 pm

### Re: LoveFS

You're right. I think that a better fix (more inline with code style) would be

Code: Select all

if self.dialog then
self:closeDialog(gspot)
end
The editor I was talking about was developed in loveframes 4 years ago. It's very very VERY incomplete and I must try it with the last loveframes version. Since the future of loveframes is uncertain, I don't know if the code is of any interest.

pgimeno
Party member
Posts: 2408
Joined: Sun Oct 18, 2015 2:58 pm

### Re: LoveFS

linux-man wrote:You're right. I think that a better fix (more inline with code style) would be

Code: Select all

if self.dialog then
self:closeDialog(gspot)
end
That might use a different gspot instance to that the previous dialog was created with, and crash. That's why I used self.dialog.Gspot, which should use the same instance.
linux-man wrote:The editor I was talking about was developed in loveframes 4 years ago. It's very very VERY incomplete and I must try it with the last loveframes version. Since the future of loveframes is uncertain, I don't know if the code is of any interest.
Thanks. I'm still interested. I've seen a few ports of loveframes to LÖVE 0.10, so not all is lost. What kind of games was it for?

linux-man
Citizen
Posts: 67
Joined: Thu Apr 28, 2011 4:51 pm

### Re: LoveFS

Never thought of using several gspot instances. Pull accepted.
Give me some time to update the editor code (the game was named "Knights" and would be a "Lords of Midnight" clone).

linux-man
Citizen
Posts: 67
Joined: Thu Apr 28, 2011 4:51 pm

### Re: LoveFS

Another update, now with a LoveFrames dialog based on a modified LoveFrames (https://github.com/linux-man/LoveFrames).
Any suggestion for other GUI?

### Who is online

Users browsing this forum: No registered users and 15 guests