-- ipair iterator which supports zero-indexing
function ipairsFromZero(t)
	if t==nil then
		print("ipairsFromZero called with nil argument")
		print(debug.traceback)

		return function()
			return nil
		end
	end

	local i=0
	local n=#t  -- # returns cardinality(t)-1 if zero is used :(

	if t[0]==nil then
		i = 1
	end

	return function()
		if (i <= n) then
			i = i + 1
			return i-1,t[i-1]
		end
	end
end

function getPath(str, sep)
    sep=sep or'/'
    return str:match("(.*"..sep..")")
end