User Tools

Site Tools


addons:functions:file

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
addons:functions:file [2017/04/21 21:41]
atom0s created
addons:functions:file [2017/04/22 00:10] (current)
Line 4: Line 4:
  
 You can access these functions via: You can access these functions via:
-<code lua>​ashita.file.</​code>+<sxh lua>​ashita.file.</​sxh>
  
 ---- ----
Line 11: Line 11:
  
 Creates a directory on the clients system. (Any sub-directories upto the end folder that are not present will also be created.) Creates a directory on the clients system. (Any sub-directories upto the end folder that are not present will also be created.)
-<code lua>bool ashita.file.create_dir(path);</​code>+<sxh lua>bool ashita.file.create_dir(path);</​sxh>
   * **Parameters**   * **Parameters**
     * path - (string) The full path to create.     * path - (string) The full path to create.
Line 22: Line 22:
  
 Determines if the given path exists. Determines if the given path exists.
-<code lua>bool ashita.file.dir_exists(path);</​code>+<sxh lua>bool ashita.file.dir_exists(path);</​sxh>
   * **Parameters**   * **Parameters**
     * path - (string) The full path to check.     * path - (string) The full path to check.
Line 32: Line 32:
  
 Determines if the given file exists. Determines if the given file exists.
-<code lua>bool ashita.file.file_exists(file);</​code>+<sxh lua>bool ashita.file.file_exists(file);</​sxh>
   * **Parameters**   * **Parameters**
     * file - (string) The full path to the file to check.     * file - (string) The full path to the file to check.
Line 41: Line 41:
 ==== ashita.file.get_directory ==== ==== ashita.file.get_directory ====
 ==== ashita.file.get_dir ==== ==== ashita.file.get_dir ====
 +
 +Obtains and returns a directories contents.
 +<sxh lua>bool ashita.file.get_dir(root,​ mask, subs);</​sxh>​
 +  * **Parameters**
 +    * root - (string) The path to the directory to obtain the contents of.
 +    * mask - (string) The mask to use while obtaining the contents. (Optional, default is '​*'​.)
 +    * subs - (bool) True if sub-directories are included in the results, false otherwise. (Optional, default is false.)
 +  * **Returns**
 +    * table - The results on success, nil otherwise.
 +
 +//If only the root path is given to this function, it will return a table containing a list of folders found within the given directory. If a mask is given, the function will instead return any file/folder that matches the mask given.//
  
 ---- ----
 ==== ashita.file.get_install_dir ==== ==== ashita.file.get_install_dir ====
 +
 +Obtains the install path to a given Square Enix entity.
 +<sxh lua>​string ashita.file.get_install_dir(langId,​ entityId);</​sxh>​
 +  * **Parameters**
 +    * langId - (number) The language id used for the proper PlayOnline registry key to lookup within.
 +    * entityId - (number) The entity id of the Square Enix product to lookup the install path to.
 +  * **Returns**
 +    * string - The path to the entity if found, nil otherwise.
 +
 +<​html><​div class="​custom-info">​
 +Language Ids:<​br>​
 +&nbsp;0 - Default (Use the default language of the current loaded client.<​br>​
 +&nbsp;1 - Japanese (Looks up registry information within PlayOnline.)<​br>​
 +&nbsp;2 - English (Looks up registry information within PlayOnlineUS.)<​br>​
 +&nbsp;3 - European (Looks up registry information within PlayOnlineEU.)<​br>​
 +<br>
 +Square Enix Entity Ids:<​br>​
 +&nbsp;0 - PlayOnline<​br>​
 +&nbsp;1 - Final Fantasy XI<​br>​
 +&nbsp;2 - Final Fantasy XI (Test Server)<​br>​
 +&nbsp;3 - Tetra Master<​br>​
 +</​div></​html>​
addons/functions/file.1492836090.txt.gz · Last modified: 2017/04/21 21:41 by atom0s