Directory.parent readonly property



The Directory.parent property returns a Directory representing the parent folder. If the folder is already a root folder, the property returns nil

Example

-- iterate through all current directory content for entry in each(sys.Directory(".")) do if type(entry) == "File" then print(entry.name) else -- entry is a directory print(entry.fullpath:match("\\.*\\([%w%p]+)$").."\\") end end