Modules/FileSystem/object/destroy: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ This function destroys the underlying object passed to it, rendering all Lua references to it null and void. All OS handles that have been associated with it are released. ==Syntax== <syntaxhighlight lang="lua"> nil fsobject:destroy () </syntaxhighlight> ==Returns== This function returns nil. ==Remarks== It is a good idea to call this function on all files or translators whose use has expired. This way the release of OS resources is guarranteed to happen at...") |
mNo edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
This function destroys the underlying object passed to it, rendering all Lua references to it null and void. All OS handles that | This function destroys the underlying object passed to it, rendering all Lua references to it null and void. All OS handles that had been associated with it are released. | ||
==Syntax== | ==Syntax== | ||
Line 11: | Line 11: | ||
==Remarks== | ==Remarks== | ||
It is a good idea to call this function on all files or translators whose use has expired. This way the release of OS resources is | It is a good idea to call this function on all files or translators whose use has expired. This way the release of OS resources is guaranteed to happen at a predictable point in time. Since all Eir FileSystem objects are '''garbage collected by default''' it is strictly-speaking not a must, but a strong recommendation. Adhering to this recommendation is a strong guideline for clean programming practice. | ||
==Example== | ==Example== | ||
Line 17: | Line 17: | ||
-- TODO. | -- TODO. | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{:Modules/FileSystem/object/functions}} | |||
{{:Modules/FileSystem/translator/functions}} | {{:Modules/FileSystem/translator/functions}} | ||
{{:Modules/FileSystem/file/functions}} | {{:Modules/FileSystem/file/functions}} |
Latest revision as of 23:04, 19 January 2022
This function destroys the underlying object passed to it, rendering all Lua references to it null and void. All OS handles that had been associated with it are released.
Syntax
nil fsobject:destroy ()
Returns
This function returns nil.
Remarks
It is a good idea to call this function on all files or translators whose use has expired. This way the release of OS resources is guaranteed to happen at a predictable point in time. Since all Eir FileSystem objects are garbage collected by default it is strictly-speaking not a must, but a strong recommendation. Adhering to this recommendation is a strong guideline for clean programming practice.
Example
-- TODO.
FileSystem Object Functions
FileSystem Translator Functions
- open
- exists
- createDir
- chdir
- delete
- copy
- rename
- size
- stat
- relPath
- relPathRoot
- absPath
- absPathRoot
- scanDir
- scanDirEx
- getDirs
- getFiles
- setOutbreakEnabled
- getOutbreakEnabled
- setPathProcessingMode
- getPathProcessingMode