docs
This commit is contained in:
@@ -18,7 +18,8 @@
|
||||
</div>
|
||||
<ul>
|
||||
<li><a class="nav-documentation" href="documentation.html">关于本文档</a></li>
|
||||
<li><a class="nav-synopsis" href="synopsis.html">如何阅读本文档</a></li>
|
||||
<li><a class="nav-http-www-w3school-com-cn-js-pro_js_syntax-asp" href="http://www.w3school.com.cn/js/pro_js_syntax.asp">W3CSchool - ECMAScript教程</a></li>
|
||||
<li><a class="nav-http-es6-ruanyifeng-com-README" href="http://es6.ruanyifeng.com/#README">阮一峰 - ECMAScript教程</a></li>
|
||||
</ul>
|
||||
<div class="line"></div>
|
||||
|
||||
@@ -97,6 +98,7 @@
|
||||
<li><span class="stability_undefined"><a href="#files_files_removedir_path">files.removeDir(path)</a></span></li>
|
||||
<li><span class="stability_undefined"><a href="#files_files_getsdcardpath">files.getSdcardPath()</a></span></li>
|
||||
<li><span class="stability_undefined"><a href="#files_files_cwd">files.cwd()</a></span></li>
|
||||
<li><span class="stability_undefined"><a href="#files_files_path_relativepath">files.path(relativePath)</a></span></li>
|
||||
<li><span class="stability_undefined"><a href="#files_files_listdir_path_filter">files.listDir(path[, filter])</a></span></li>
|
||||
<li><span class="stability_undefined"><a href="#files_open_path_mode_r_encoding_utf_8_buffersize_8192">open(path[, mode = "r", encoding = "utf-8", bufferSize = 8192])</a></span></li>
|
||||
</ul>
|
||||
@@ -308,6 +310,12 @@ app.viewFile("/sdcard/1.txt");
|
||||
</ul>
|
||||
</div><p>返回脚本的"当前工作文件夹路径"。该路径指的是,如果脚本本身为脚本文件,则返回这个脚本文件所在目录;否则返回<code>null</code>获取其他设定路径。</p>
|
||||
<p>例如,对于脚本文件"/sdcard/脚本/1.js"运行<code>files.cwd()</code>返回"/sdcard/脚本/"。</p>
|
||||
<h2>files.path(relativePath)<span><a class="mark" href="#files_files_path_relativepath" id="files_files_path_relativepath">#</a></span></h2>
|
||||
<div class="signature"><ul>
|
||||
<li><code>relativePath</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a> 相对路径</li>
|
||||
<li>返回 <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
|
||||
</ul>
|
||||
</div><p>返回相对路径对应的绝对路径。例如<code>files.path("./1.png")</code>,如果运行这个语句的脚本位于文件夹"/sdcard/脚本/"中,则返回<code>"/sdcard/脚本/1.png"</code>。</p>
|
||||
<h2>files.listDir(path[, filter])<span><a class="mark" href="#files_files_listdir_path_filter" id="files_files_listdir_path_filter">#</a></span></h2>
|
||||
<div class="signature"><ul>
|
||||
<li><code>path</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a> 路径</li>
|
||||
|
||||
Reference in New Issue
Block a user