fs.combine

Concatenates path pathA with path pathB, such that pathB appears after pathA. A naïve implementation of this function would be pathA .. "/" .. pathB. fs.combine should always be preferred over such a pattern, as this function will take care of special cases, such as when pathB starts with a forward slash, and typeA ends with a forward slash. The naïve implementation would generate three forward slashes between the paths.

ExampleCreating a path to a directory within the ROM directory
Prints the combination of the paths /rom and /dir/test.
Code
<nowiki>
print(fs.combine("/rom", "/dir/test"))
    </nowiki>
Output rom/dir/test

fs.combine
Function
Syntax
fs.combine(
  • pathA : string
  • pathB : string
)

Returns string
API fs
Source CC:Tweaked (source)
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.