unixpath

function unixpath( path ) --> upath

Description

Converts a path to the unix style version.

Parameters

path

A unix or windows style path.

Return Values

upath

A unix style version of the path.

Code

--ZFUNC-unixpath-v1
local function unixpath( path ) --> upath
   return path:gsub( "\\", "/" )
end

return unixpath

Examples

local t = require( "tapered" )
local unixpath = require( "unixpath" )

t.is( "C:/a/b/c", unixpath[[C:\a\b\c]] )

t.done()

See also