Okay, I have tested the new version on Ubuntu now and it seems to be working just fine. It features detection of Linux desktops without gnome and Macs, and opening of files for them
Please tell me how it runs on OSX
Filesystem Hack: Set Identity to Whatever You Want
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Filesystem Hack: Set Identity to Whatever You Want
- Attachments
-
- File Explorer.love
- Version 1.2
- (1.32 KiB) Downloaded 97 times
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Filesystem Hack: Set Identity to Whatever You Want
popen isn't supported for me it seems. How about using os.execute with output redirection, like this:
I haven't tested it, nor did I look at the manual, but I think that's correct.
Man I find Lua's lack of functionality annoying.
Code: Select all
local file = os.tmpname()
os.execute('uname -s > ' .. file)
local f = io.open(file)
local os = f:read('*a')
f:close()
Man I find Lua's lack of functionality annoying.
Re: Filesystem Hack: Set Identity to Whatever You Want
Or use io.popen() instead of os.execute()
Code: Select all
local f = io.popen("pwd") -- runs command
local l = f:read("*a") -- read output of command
print(l)
f:close()
Code: Select all
function execute(cmd)
local f = io.popen(cmd)
local str = f:read("*a")
return str
end
function str2tbl(str, sep)
sep = sep or "\n"
local t = {}
for line in string.gmatch(str, "[^\n]+") do
table.insert(t, line)
end
return t
end
table.foreach(str2tbl(execute("uname -s")), print)
My projects current projects : dragoon-framework (includes lua-newmodule, lua-provide, lovemodular, , classcommons2, and more ...)
Re: Filesystem Hack: Set Identity to Whatever You Want
BlackBulletIV wrote:popen isn't supported for me it seems.
- slime
- Solid Snayke
- Posts: 3132
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Filesystem Hack: Set Identity to Whatever You Want
io.popen works fine using a regular Lua install but says it's not supported when I run it through LÖVE, oddly enough (OSX).
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Filesystem Hack: Set Identity to Whatever You Want
It is non-portable, and it seems most love distributed lua builds don't support it.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 83 guests