pathIsFile | Multi Theft Auto: Wiki Skip to content

pathIsFile

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


Checks if a specified path points to a file.

OOP Syntax Help! I don't understand this!

  • Method: path:isFile(...)

Syntax

bool pathIsFile ( string path )
Required Arguments
  • path: A string containing a path you want to check against

Returns

  • bool: value

Returns true if the path points to a file, false otherwise.

Code Examples

shared

This example lists all files in a directory

local files = {}
for _,entry in ipairs(pathListDir('.')) do
if pathIsFile(entry) then
table.insert(files, entry)
end
end
iprint('Files:')
for _,file in ipairs(files) do
iprint(' - '..file)
end

See Also

Path Functions