fs.splitpathΒΆ

string,string,string,string,string directory,basename,extension,separator,frame fs.splitpath ( string path , bool withframes )

Split the file into directory, basename, extension and optionally frame number

This function decomposes a path into directory, base name, optionally frame number and extension. For instance, "c:/some/directory/a_file_name.blah" is split into "c:/some/directory", "a_file_name" and "blah".

When withframes is true, the base name is split with frame numbering expected at the end. For instance, "c:/some/directory/an_image_0050.png" is split into "c:/some/directory", "an_image", "_" as separator, "0050" as frame and "png".

Note that any return token might be nil is not matched in the path. "an_image_0050.png" returns an nil directory.

Arguments:

  • path the path to split
  • withframes decompose frame numbers as well

Return:

  • directory,basename,extension,separator,frame