Skip to content

Repository files navigation

lua-path

LicenceBuild StatusBuild StatusCoverage Status

Documentation

View entire documentation here

Usage

localPATH=require"path"-- suppose we run on windowsassert(PATH.IS_WINDOWS)
-- we can use system dependet functionprint(PATH.user_home()) -- C:\Documents and Settings\Adminprint(PATH.currentdir()) -- C:\lua\5.1-- but we can use specific system path notationlocalftp_path=PATH.new('/')
print(ftp_path.join("/root", "some", "dir")) -- /root/some/dir-- All functions specific to system will failassert(notpcall( ftp_path.currentdir ) )
-- clean currentdirlocalpath=require"path"path.each("./*", function(P, mode)
ifmode=='directory' thenpath.rmdir(P)
elsepath.remove(P)
endend,{
param="fm"; -- request full path and modedelay=true; -- use snapshot of directoryrecurse=true; -- include subdirsreverse=true; -- subdirs at first 
})

About

File system path manipulation library

Topics

Resources

Stars

90 stars

Watchers

9 watching

Forks

Releases

Packages

Used by

Contributors

Languages