Author Topic: require("pxlfs") AND linux Debian not work !  (Read 3264 times)

0 Members and 1 Guest are viewing this topic.

Offline Hamachi

  • Forum Ace
  • *****
  • Posts: 88
  • Karma: +0/-7
require("pxlfs") AND linux Debian not work !
« on: 04 December, 2010, 22:38:21 »
Hey i have som problems whit scripts whit require("pxlfs") on my linux server some there can help ?

Have install pack:
sudo apt-get install liblua5.1-0 liblua5.1-0-dev lua5.1 liblua5.1-filesystem0 liblua5.1-socket2 liblua5.1-sql-mysql-2 liblua5.1-sql-sqlite3-2 zlib1g-dev make g++

Thanks :)

PtokaX forum

require("pxlfs") AND linux Debian not work !
« on: 04 December, 2010, 22:38:21 »

Offline mariner

  • Member
  • ***
  • Posts: 25
  • Karma: +2/-5
    • [K.lan]Project (now tested)
Re: require("pxlfs") AND linux Debian not work !
« Reply #1 on: 05 December, 2010, 00:04:18 »
Replace require("pxlfs") with require("lfs")
Eat my bolts, bastard... ? member of Devaster Squad

sudo ./configure_brain.sh

Offline Hamachi

  • Forum Ace
  • *****
  • Posts: 88
  • Karma: +0/-7
Re: require("pxlfs") AND linux Debian not work !
« Reply #2 on: 05 December, 2010, 12:31:05 »
Thanks

Have try it before but it not work, but it work now :D

Are there a command so i can see the hub run on Linux or Win ?

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 481
  • Karma: +209/-22
  • PtokaX developer
Re: require("pxlfs") AND linux Debian not work !
« Reply #3 on: 05 December, 2010, 17:45:37 »
/stats
Quote
Version: PtokaX DC Hub 0.4.1.2c x64 built on Jul  9 2010 01:17:01
OS: Windows 7
Quote
Version: PtokaX DC Hub 0.4.1.2c built on Oct 30 2010 23:06:42
OS: Linux 2.6.32.22 (x86_64)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline Hamachi

  • Forum Ace
  • *****
  • Posts: 88
  • Karma: +0/-7
Re: require("pxlfs") AND linux Debian not work !
« Reply #4 on: 05 December, 2010, 21:18:52 »
hmm

where can i use that !

it is for somfing like this:

if os.px == linux then
   require("lfs") -- LINUX
else
   require("pxlfs") -- WIN
end

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 481
  • Karma: +209/-22
  • PtokaX developer
Re: require("pxlfs") AND linux Debian not work !
« Reply #5 on: 06 December, 2010, 11:09:43 »
Lua API don't have call to check what on what OS PtokaX is running, simply because it is hard to do ::) Many systems returning crazy OS identification (for example wtf is SunOS 5.11 (i86pc) ?) :-X
You can use Core.GetPtokaXPath() to check if is running on Unix like system (path will start with /)  8)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline mariner

  • Member
  • ***
  • Posts: 25
  • Karma: +2/-5
    • [K.lan]Project (now tested)
Re: require("pxlfs") AND linux Debian not work !
« Reply #6 on: 06 December, 2010, 18:40:11 »
Use this code
Code: [Select]
path,selfname = debug.getinfo(1).source:match("^@?(.+[/\\]).-[/\\](.-)$")
path = path:gsub("\\","/")

if path:find("^/") then -- OS detection
require "lfs" -- Linux
else
require"pxlfs" -- Windows
end
Eat my bolts, bastard... ? member of Devaster Squad

sudo ./configure_brain.sh

Offline mariner

  • Member
  • ***
  • Posts: 25
  • Karma: +2/-5
    • [K.lan]Project (now tested)
Re: require("pxlfs") AND linux Debian not work !
« Reply #7 on: 07 December, 2010, 16:38:10 »
Hm, I copied this code from the working script.
Eat my bolts, bastard... ? member of Devaster Squad

sudo ./configure_brain.sh

PtokaX forum

Re: require("pxlfs") AND linux Debian not work !
« Reply #7 on: 07 December, 2010, 16:38:10 »