Modules/FileSystem/createFileIterative

From Multi Theft Auto: Wiki
Revision as of 23:46, 18 January 2022 by Danilo (talk | contribs) (Created page with "__NOTOC__ This function attempts to create a file with numeric iteration for filename collision avoidance. If a specific filename is taken then an the algorithm will try to create the next file with increased numeric insert. ==Syntax== <syntaxhighlight lang="lua"> file fsnamespace.createFileIterative( translator target, string prefix, string suffix, int maxIterations ) </syntaxhighlight> ==Arguments== *'''target''': the file translator based on which to create the file...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function attempts to create a file with numeric iteration for filename collision avoidance. If a specific filename is taken then an the algorithm will try to create the next file with increased numeric insert.

Syntax

file fsnamespace.createFileIterative( translator target, string prefix, string suffix, int maxIterations )

Arguments

  • target: the file translator based on which to create the file
  • prefix: part of file path before the numeric insert
  • suffix: part of file path after the numeric insert (for example the file extention)
  • maxIterations: integral number of tries for the existing filename collisions

Returns

This function returns a newly created file handle distinct from any other colliding one if successful, false otherwise.

Example

-- TODO

FileSystem Namespace Functions

FileSystem File Functions

FileSystem Translator Functions