Modules/FileSystem/createFileIterative: Difference between revisions
Jump to navigation
Jump to search
(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...") |
No edit summary |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
<pageclass class="#e36242" subcaption="Namespace function"></pageclass> | |||
__NOTOC__ | __NOTOC__ | ||
This function attempts to create a file with numeric iteration for filename collision avoidance. If a specific filename is taken then | This function attempts to create a file with numeric iteration for filename collision avoidance. If a specific filename is taken then the algorithm will try to create the next file with increased numeric insert. | ||
==Syntax== | ==Syntax== | ||
Line 11: | Line 12: | ||
*'''prefix''': part of file path before the numeric insert | *'''prefix''': part of file path before the numeric insert | ||
*'''suffix''': part of file path after the numeric insert (for example the file extention) | *'''suffix''': part of file path after the numeric insert (for example the file extention) | ||
*'''maxIterations''': integral number of tries for the existing filename collisions | *'''maxIterations''': integral number of tries for the existing filename collisions (greater than 0) | ||
==Returns== | ==Returns== |
Latest revision as of 03:57, 23 January 2022
This function attempts to create a file with numeric iteration for filename collision avoidance. If a specific filename is taken then 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 (greater than 0)
Returns
This function returns a newly created file handle distinct from any other colliding one if successful, false otherwise.
Example
-- TODO
FileSystem Namespace Functions
- createTranslator
- createRAMDisk
- createMemoryFile
- createFileIterative
- copyFile
- copyStream
- copyStreamCount
- pathToFilename
- streamCompare
- topointer
- type
- setDoBufferAllRaw
- getDoBufferAllRaw
FileSystem File Functions
- read
- readByte
- readUByte
- readShort
- readUShort
- readInt
- readUInt
- readFloat
- readDouble
- readBoolean
- write
- writeByte
- writeUByte
- writeShort
- writeUShort
- writeInt
- writeUInt
- writeFloat
- writeDouble
- writeBoolean
- size
- stat
- tell
- seek
- eof
- flush
- isWritable
- isReadable