File: fpath.lua

package info (click to toggle)
lua-torch-sys 0~20161027-gf073f05-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 112 kB
  • sloc: ansic: 69; makefile: 9
file content (10 lines) | stat: -rw-r--r-- 436 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
--------------------------------------------------------------------------------
-- always returns the path of the file running
--------------------------------------------------------------------------------
local function fpath()
   local fpath = _G.debug.getinfo(2).source:gsub('@','')
   if fpath:find('/') ~= 1 then fpath = paths.concat(paths.cwd(),fpath) end
   return paths.dirname(fpath),paths.basename(fpath)
end

return fpath