Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/xlua.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2015-07-24 10:20:39 +0300
committerSoumith Chintala <soumith@gmail.com>2015-07-24 10:20:39 +0300
commit73706a9f4c85beba43b9d781de6a60524c4877a9 (patch)
treea82edfb0c8b1a725c7c28dfd547d09e2961ea802
parent775ed6c39195470da876ab111bf02cc6b790e04e (diff)
parent0dec9deca56f09ecf8c8e11cbc1a0d9cc3a891e6 (diff)
Merge pull request #8 from samehkhamis/master
Making things work under windows
-rw-r--r--init.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index e6036b1..b803786 100644
--- a/init.lua
+++ b/init.lua
@@ -110,7 +110,7 @@ rawset(_G, 'xprint', xlua.print)
-- log all session, by replicating stdout to a file
----------------------------------------------------------------------
function xlua.log(file)
- os.execute('mkdir -p "' .. sys.dirname(file) .. '"')
+ os.execute('mkdir ' .. (sys.uname() ~= 'windows' and '-p ' or '') .. ' "' .. sys.dirname(file) .. '"')
local f = assert(io.open(file,'w'))
io._write = io.write
_G._print = _G.print
@@ -220,6 +220,7 @@ local formatTime = xlua.formatTime
----------------------------------------------------------------------
do
local function getTermLength()
+ if sys.uname() == 'windows' then return 80 end
local tputf = io.popen('tput cols', 'r')
local w = tonumber(tputf:read('*a'))
local rc = {tputf:close()}