<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/Modules/FileSystem/translator/chdir?action=history&amp;feed=atom</id>
	<title>Modules/FileSystem/translator/chdir - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/Modules/FileSystem/translator/chdir?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/chdir&amp;action=history"/>
	<updated>2026-05-13T12:43:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/chdir&amp;diff=73764&amp;oldid=prev</id>
		<title>Danilo at 03:25, 23 January 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/chdir&amp;diff=73764&amp;oldid=prev"/>
		<updated>2022-01-23T03:25:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 03:25, 23 January 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pageclass class=&quot;#3c82c8&quot; subcaption=&quot;Translator function&quot;&gt;&amp;lt;/pageclass&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__NOTOC__&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__NOTOC__&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function changes the current directory pointer of the translator. All operations on the FileSystem translator are executed relative to the current directory. The translator, if possible, is asked to prevent deletion of the current directory.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function changes the current directory pointer of the translator. All operations on the FileSystem translator are executed relative to the current directory. The translator, if possible, is asked to prevent deletion of the current directory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-73624:rev-73764 --&gt;
&lt;/table&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/chdir&amp;diff=73624&amp;oldid=prev</id>
		<title>Danilo: Created page with &quot;__NOTOC__ This function changes the current directory pointer of the translator. All operations on the FileSystem translator are executed relative to the current directory. The translator, if possible, is asked to prevent deletion of the current directory.  ==Syntax== &lt;syntaxhighlight lang=&quot;lua&quot;&gt; bool translator:chdir ( string dirPath )  &lt;/syntaxhighlight&gt;  ==Arguments== *'''dirPath:''' a path to a directory that should be made current directory  ==Returns== This functio...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/chdir&amp;diff=73624&amp;oldid=prev"/>
		<updated>2022-01-19T02:51:09Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__ This function changes the current directory pointer of the translator. All operations on the FileSystem translator are executed relative to the current directory. The translator, if possible, is asked to prevent deletion of the current directory.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool translator:chdir ( string dirPath )  &amp;lt;/syntaxhighlight&amp;gt;  ==Arguments== *&amp;#039;&amp;#039;&amp;#039;dirPath:&amp;#039;&amp;#039;&amp;#039; a path to a directory that should be made current directory  ==Returns== This functio...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
This function changes the current directory pointer of the translator. All operations on the FileSystem translator are executed relative to the current directory. The translator, if possible, is asked to prevent deletion of the current directory.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool translator:chdir ( string dirPath ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''dirPath:''' a path to a directory that should be made current directory&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns '''true''' if the directory pointed at by dirPath is an existing directory and can be accessed by the translator, '''false''' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This snippet creates a simple command-based filesystem explorer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Create a generic FileSystem translator.&lt;br /&gt;
local cmdTranslator = fileCreateTranslator( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
-- Set up some commands.&lt;br /&gt;
addCommandHandler( &amp;quot;chdir&amp;quot;,&lt;br /&gt;
    function(...)&lt;br /&gt;
        local myPath = table.concat( { ... }, &amp;quot; &amp;quot; );&lt;br /&gt;
&lt;br /&gt;
        cmdTranslator:chdir( myPath );&lt;br /&gt;
    end&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
addCommandHandler( &amp;quot;dir&amp;quot;,&lt;br /&gt;
    function()&lt;br /&gt;
        -- todo: resolve a path given as arguments.&lt;br /&gt;
&lt;br /&gt;
        local myEntries = {};&lt;br /&gt;
&lt;br /&gt;
        local function itemIterator( path )&lt;br /&gt;
            table.insert( myEntries, cmdTranslator:relPath( path ) );&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        cmdTranslator:scanDirEx( &amp;quot;/&amp;quot;, &amp;quot;*&amp;quot;, itemIterator, itemIterator, false );&lt;br /&gt;
&lt;br /&gt;
        -- Output the filesystem entries to the chatbox.&lt;br /&gt;
        for m,n in ipairs( myEntries ) do&lt;br /&gt;
            outputChatBox( n );&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        -- todo: print statistics (file size, number of files, number of directories, ...)&lt;br /&gt;
    end&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
</feed>