Skip to content

file.parent

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Get the parent directory of the given path

Parameters

Parameter Default Value Note
path

Return value

Condition Return Value
(always) number

Notes

Example

import "file"
print file.parent("/home/user/docs/report.txt")   // "/home/user/docs"

Clone this wiki locally