11f128b37Sopenharmony_ci# Distributed File<a name="EN-US_TOPIC_0000001101541814"></a> 21f128b37Sopenharmony_ci 31f128b37Sopenharmony_ci- [Introduction](#section104mcpsimp) 41f128b37Sopenharmony_ci - [Architecture](#section110mcpsimp) 51f128b37Sopenharmony_ci 61f128b37Sopenharmony_ci- [Directory](#section113mcpsimp) 71f128b37Sopenharmony_ci- [Constraints](#section117mcpsimp) 81f128b37Sopenharmony_ci- [Usage](#section125mcpsimp) 91f128b37Sopenharmony_ci - [Available APIs](#section127mcpsimp) 101f128b37Sopenharmony_ci - [Usage Guidelines](#section149mcpsimp) 111f128b37Sopenharmony_ci 121f128b37Sopenharmony_ci- [Repositories Involved](#section178mcpsimp) 131f128b37Sopenharmony_ci 141f128b37Sopenharmony_ci## Introduction<a name="section104mcpsimp"></a> 151f128b37Sopenharmony_ci 161f128b37Sopenharmony_ciCurrently, the Distributed File subsystem provides apps with JavaScript APIs for I/O capabilities, including APIs for managing files and directories, obtaining file information, reading and writing data streams of files, and receiving URIs rather than absolute paths. 171f128b37Sopenharmony_ci 181f128b37Sopenharmony_ci### Architecture<a name="section110mcpsimp"></a> 191f128b37Sopenharmony_ci 201f128b37Sopenharmony_ciCurrently, the Distributed File subsystem provides only local JavaScript file APIs for apps through the FileIO and File modules. The Distributed File subsystem uses LibN to abstract APIs at the NAPI layer, providing basic capabilities such as the basic type system, memory management, and general programming models for the subsystem. This subsystem depends on the engine layer of the JS application development framework to provide the capability of converting JavaScript APIs into C++ code, depends on the application framework to provide app-related directories, and depends on the GLIBC runtimes to provide I/O capabilities. 211f128b37Sopenharmony_ci 221f128b37Sopenharmony_ci**Figure 1** Distributed File subsystem architecture<a name="fig174088216114"></a> 231f128b37Sopenharmony_ci 241f128b37Sopenharmony_ci 251f128b37Sopenharmony_ci## Directory<a name="section113mcpsimp"></a> 261f128b37Sopenharmony_ci 271f128b37Sopenharmony_ci``` 281f128b37Sopenharmony_cifoundation/distributeddatamgr/distributedfile 291f128b37Sopenharmony_ci├── figures # Figures 301f128b37Sopenharmony_ci├── interfaces # APIs 311f128b37Sopenharmony_ci├ └── kits # APIs exposed externally 321f128b37Sopenharmony_ci├── utils # Common Components 331f128b37Sopenharmony_ci├ └── filemgmt_libhilog # Log Components 341f128b37Sopenharmony_ci├ └── filemgmt_libn # Platform related components 351f128b37Sopenharmony_ci``` 361f128b37Sopenharmony_ci 371f128b37Sopenharmony_ci## Constraints<a name="section117mcpsimp"></a> 381f128b37Sopenharmony_ci 391f128b37Sopenharmony_ciConstraints on local I/O APIs: 401f128b37Sopenharmony_ci 411f128b37Sopenharmony_ci- Only UTF-8/16 encoding is supported. 421f128b37Sopenharmony_ci- The URIs cannot include external storage directories. 431f128b37Sopenharmony_ci 441f128b37Sopenharmony_ci## Usage<a name="section125mcpsimp"></a> 451f128b37Sopenharmony_ci 461f128b37Sopenharmony_ci### Available APIs<a name="section127mcpsimp"></a> 471f128b37Sopenharmony_ci 481f128b37Sopenharmony_ciCurrently, the Distributed File subsystem provides APIs for accessing local files and directories. The following table describes the API types classified by function. 491f128b37Sopenharmony_ci 501f128b37Sopenharmony_ci**Table 1** API types 511f128b37Sopenharmony_ci 521f128b37Sopenharmony_ci<a name="table99228171027"></a> 531f128b37Sopenharmony_ci<table><thead align="left"><tr id="row2092221715211"><th class="cellrowborder" valign="top" width="15.02%" id="mcps1.2.5.1.1"><p id="p79225171524"><a name="p79225171524"></a><a name="p79225171524"></a>API Type</p> 541f128b37Sopenharmony_ci</th> 551f128b37Sopenharmony_ci<th class="cellrowborder" valign="top" width="32.25%" id="mcps1.2.5.1.2"><p id="p992271711216"><a name="p992271711216"></a><a name="p992271711216"></a>Function</p> 561f128b37Sopenharmony_ci</th> 571f128b37Sopenharmony_ci<th class="cellrowborder" valign="top" width="25.840000000000003%" id="mcps1.2.5.1.3"><p id="p29225175213"><a name="p29225175213"></a><a name="p29225175213"></a>Related Module</p> 581f128b37Sopenharmony_ci</th> 591f128b37Sopenharmony_ci<th class="cellrowborder" valign="top" width="26.889999999999997%" id="mcps1.2.5.1.4"><p id="p129221017720"><a name="p129221017720"></a><a name="p129221017720"></a>Example API (<em id="i15670628145315"><a name="i15670628145315"></a><a name="i15670628145315"></a>Class Name</em>.<em id="i6859230125316"><a name="i6859230125316"></a><a name="i6859230125316"></a>Method Name</em>)</p> 601f128b37Sopenharmony_ci</th> 611f128b37Sopenharmony_ci</tr> 621f128b37Sopenharmony_ci</thead> 631f128b37Sopenharmony_ci<tbody><tr id="row149231717327"><td class="cellrowborder" valign="top" width="15.02%" headers="mcps1.2.5.1.1 "><p id="p3923417629"><a name="p3923417629"></a><a name="p3923417629"></a>Basic file API</p> 641f128b37Sopenharmony_ci</td> 651f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="32.25%" headers="mcps1.2.5.1.2 "><p id="p89236171124"><a name="p89236171124"></a><a name="p89236171124"></a>Creates, modifies, and accesses files, and changes file permissions based on the specified absolute paths or file descriptors.</p> 661f128b37Sopenharmony_ci</td> 671f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="25.840000000000003%" headers="mcps1.2.5.1.3 "><p id="p22011844349"><a name="p22011844349"></a><a name="p22011844349"></a>@OHOS.distributedfile.fileio</p> 681f128b37Sopenharmony_ci</td> 691f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="26.889999999999997%" headers="mcps1.2.5.1.4 "><p id="p1784383174320"><a name="p1784383174320"></a><a name="p1784383174320"></a>accessSync</p> 701f128b37Sopenharmony_ci<p id="p184313310437"><a name="p184313310437"></a><a name="p184313310437"></a>chownSync</p> 711f128b37Sopenharmony_ci<p id="p1684318315436"><a name="p1684318315436"></a><a name="p1684318315436"></a>chmodSync</p> 721f128b37Sopenharmony_ci</td> 731f128b37Sopenharmony_ci</tr> 741f128b37Sopenharmony_ci<tr id="row1692320171825"><td class="cellrowborder" valign="top" width="15.02%" headers="mcps1.2.5.1.1 "><p id="p392391710219"><a name="p392391710219"></a><a name="p392391710219"></a>Basic directory API</p> 751f128b37Sopenharmony_ci</td> 761f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="32.25%" headers="mcps1.2.5.1.2 "><p id="p109232176211"><a name="p109232176211"></a><a name="p109232176211"></a>Reads directories and determines file types based on the specified absolute paths.</p> 771f128b37Sopenharmony_ci</td> 781f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="25.840000000000003%" headers="mcps1.2.5.1.3 "><p id="p271274219410"><a name="p271274219410"></a><a name="p271274219410"></a>@OHOS.distributedfile.fileio</p> 791f128b37Sopenharmony_ci</td> 801f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="26.889999999999997%" headers="mcps1.2.5.1.4 "><p id="p29233177216"><a name="p29233177216"></a><a name="p29233177216"></a>Dir.openDirSync</p> 811f128b37Sopenharmony_ci</td> 821f128b37Sopenharmony_ci</tr> 831f128b37Sopenharmony_ci<tr id="row14923171716217"><td class="cellrowborder" valign="top" width="15.02%" headers="mcps1.2.5.1.1 "><p id="p159234176215"><a name="p159234176215"></a><a name="p159234176215"></a>Basic statistical API</p> 841f128b37Sopenharmony_ci</td> 851f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="32.25%" headers="mcps1.2.5.1.2 "><p id="p1992314179215"><a name="p1992314179215"></a><a name="p1992314179215"></a>Collects basic statistics including the file size, access permission, and modification time based on the specified absolute paths.</p> 861f128b37Sopenharmony_ci</td> 871f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="25.840000000000003%" headers="mcps1.2.5.1.3 "><p id="p325774111413"><a name="p325774111413"></a><a name="p325774111413"></a>@OHOS.distributedfile.fileio</p> 881f128b37Sopenharmony_ci</td> 891f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="26.889999999999997%" headers="mcps1.2.5.1.4 "><p id="p59231317420"><a name="p59231317420"></a><a name="p59231317420"></a>Stat.statSync</p> 901f128b37Sopenharmony_ci</td> 911f128b37Sopenharmony_ci</tr> 921f128b37Sopenharmony_ci<tr id="row692319171228"><td class="cellrowborder" valign="top" width="15.02%" headers="mcps1.2.5.1.1 "><p id="p1592318171526"><a name="p1592318171526"></a><a name="p1592318171526"></a>Streaming file API</p> 931f128b37Sopenharmony_ci</td> 941f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="32.25%" headers="mcps1.2.5.1.2 "><p id="p992311171421"><a name="p992311171421"></a><a name="p992311171421"></a>Reads and writes data streams of files based on the specified absolute paths or file descriptors.</p> 951f128b37Sopenharmony_ci</td> 961f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="25.840000000000003%" headers="mcps1.2.5.1.3 "><p id="p1692321716217"><a name="p1692321716217"></a><a name="p1692321716217"></a>@OHOS.distributedfile.fileio</p> 971f128b37Sopenharmony_ci</td> 981f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="26.889999999999997%" headers="mcps1.2.5.1.4 "><p id="p10923141711215"><a name="p10923141711215"></a><a name="p10923141711215"></a>Stream.createStreamSync</p> 991f128b37Sopenharmony_ci<p id="p88031126184311"><a name="p88031126184311"></a><a name="p88031126184311"></a>Stream.fdopenStreamSync</p> 1001f128b37Sopenharmony_ci</td> 1011f128b37Sopenharmony_ci</tr> 1021f128b37Sopenharmony_ci<tr id="row82479241516"><td class="cellrowborder" valign="top" width="15.02%" headers="mcps1.2.5.1.1 "><p id="p12923111711216"><a name="p12923111711216"></a><a name="p12923111711216"></a>Sandbox file API</p> 1031f128b37Sopenharmony_ci</td> 1041f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="32.25%" headers="mcps1.2.5.1.2 "><p id="p49237171020"><a name="p49237171020"></a><a name="p49237171020"></a>Provides a subset or a combination of the capabilities provided by the basic file, directory, and statistical APIs based on the specified URIs.</p> 1051f128b37Sopenharmony_ci</td> 1061f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="25.840000000000003%" headers="mcps1.2.5.1.3 "><p id="p724852418510"><a name="p724852418510"></a><a name="p724852418510"></a>@system.file</p> 1071f128b37Sopenharmony_ci</td> 1081f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="26.889999999999997%" headers="mcps1.2.5.1.4 "><p id="p0390135216324"><a name="p0390135216324"></a><a name="p0390135216324"></a>move</p> 1091f128b37Sopenharmony_ci<p id="p202016525456"><a name="p202016525456"></a><a name="p202016525456"></a>copy</p> 1101f128b37Sopenharmony_ci<p id="p8142558194520"><a name="p8142558194520"></a><a name="p8142558194520"></a>list</p> 1111f128b37Sopenharmony_ci</td> 1121f128b37Sopenharmony_ci</tr> 1131f128b37Sopenharmony_ci</tbody> 1141f128b37Sopenharmony_ci</table> 1151f128b37Sopenharmony_ci 1161f128b37Sopenharmony_ciThe URIs used in sandbox file APIs are classified into three types, as described in the following table. 1171f128b37Sopenharmony_ci 1181f128b37Sopenharmony_ci**Table 2** URI types 1191f128b37Sopenharmony_ci 1201f128b37Sopenharmony_ci<a name="table947391523311"></a> 1211f128b37Sopenharmony_ci<table><thead align="left"><tr id="row84733151332"><th class="cellrowborder" valign="top" width="13.969999999999999%" id="mcps1.2.5.1.1"><p id="p32271219113313"><a name="p32271219113313"></a><a name="p32271219113313"></a>Directory Type</p> 1221f128b37Sopenharmony_ci</th> 1231f128b37Sopenharmony_ci<th class="cellrowborder" valign="top" width="16.41%" id="mcps1.2.5.1.2"><p id="p3227191993310"><a name="p3227191993310"></a><a name="p3227191993310"></a>Prefix</p> 1241f128b37Sopenharmony_ci</th> 1251f128b37Sopenharmony_ci<th class="cellrowborder" valign="top" width="22%" id="mcps1.2.5.1.3"><p id="p192277196333"><a name="p192277196333"></a><a name="p192277196333"></a>Access Visibility</p> 1261f128b37Sopenharmony_ci</th> 1271f128b37Sopenharmony_ci<th class="cellrowborder" valign="top" width="47.620000000000005%" id="mcps1.2.5.1.4"><p id="p18227719103313"><a name="p18227719103313"></a><a name="p18227719103313"></a>Description</p> 1281f128b37Sopenharmony_ci</th> 1291f128b37Sopenharmony_ci</tr> 1301f128b37Sopenharmony_ci</thead> 1311f128b37Sopenharmony_ci<tbody><tr id="row1474161514330"><td class="cellrowborder" valign="top" width="13.969999999999999%" headers="mcps1.2.5.1.1 "><p id="p9896152614335"><a name="p9896152614335"></a><a name="p9896152614335"></a>Temporary directory</p> 1321f128b37Sopenharmony_ci</td> 1331f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="16.41%" headers="mcps1.2.5.1.2 "><p id="p389632610335"><a name="p389632610335"></a><a name="p389632610335"></a>internal://cache/</p> 1341f128b37Sopenharmony_ci</td> 1351f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="22%" headers="mcps1.2.5.1.3 "><p id="p989610267332"><a name="p989610267332"></a><a name="p989610267332"></a>Current app only</p> 1361f128b37Sopenharmony_ci</td> 1371f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="47.620000000000005%" headers="mcps1.2.5.1.4 "><p id="p16896726173311"><a name="p16896726173311"></a><a name="p16896726173311"></a>Readable and writable, and can be cleared at any time. This directory is usually used for temporary downloads or caches.</p> 1381f128b37Sopenharmony_ci</td> 1391f128b37Sopenharmony_ci</tr> 1401f128b37Sopenharmony_ci<tr id="row194741315193312"><td class="cellrowborder" valign="top" width="13.969999999999999%" headers="mcps1.2.5.1.1 "><p id="p12896142620339"><a name="p12896142620339"></a><a name="p12896142620339"></a>Private directory of an app</p> 1411f128b37Sopenharmony_ci</td> 1421f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="16.41%" headers="mcps1.2.5.1.2 "><p id="p118969269332"><a name="p118969269332"></a><a name="p118969269332"></a>internal://app/</p> 1431f128b37Sopenharmony_ci</td> 1441f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="22%" headers="mcps1.2.5.1.3 "><p id="p189612263333"><a name="p189612263333"></a><a name="p189612263333"></a>Current app only</p> 1451f128b37Sopenharmony_ci</td> 1461f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="47.620000000000005%" headers="mcps1.2.5.1.4 "><p id="p1089682623314"><a name="p1089682623314"></a><a name="p1089682623314"></a>Deleted when the app is uninstalled.</p> 1471f128b37Sopenharmony_ci</td> 1481f128b37Sopenharmony_ci</tr> 1491f128b37Sopenharmony_ci<tr id="row204743152331"><td class="cellrowborder" valign="top" width="13.969999999999999%" headers="mcps1.2.5.1.1 "><p id="p3896152673319"><a name="p3896152673319"></a><a name="p3896152673319"></a>External storage</p> 1501f128b37Sopenharmony_ci</td> 1511f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="16.41%" headers="mcps1.2.5.1.2 "><p id="p158961526113310"><a name="p158961526113310"></a><a name="p158961526113310"></a>internal://share/</p> 1521f128b37Sopenharmony_ci</td> 1531f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="22%" headers="mcps1.2.5.1.3 "><p id="p16896326133310"><a name="p16896326133310"></a><a name="p16896326133310"></a>All apps</p> 1541f128b37Sopenharmony_ci</td> 1551f128b37Sopenharmony_ci<td class="cellrowborder" valign="top" width="47.620000000000005%" headers="mcps1.2.5.1.4 "><p id="p5897126113313"><a name="p5897126113313"></a><a name="p5897126113313"></a>Deleted when the app is uninstalled. Other apps with granted permissions can read and write files in this directory.</p> 1561f128b37Sopenharmony_ci</td> 1571f128b37Sopenharmony_ci</tr> 1581f128b37Sopenharmony_ci</tbody> 1591f128b37Sopenharmony_ci</table> 1601f128b37Sopenharmony_ci 1611f128b37Sopenharmony_ci### Usage Guidelines<a name="section149mcpsimp"></a> 1621f128b37Sopenharmony_ci 1631f128b37Sopenharmony_ciThe I/O APIs provided by the Distributed File subsystem can be classified into the following types based on the programming model: 1641f128b37Sopenharmony_ci 1651f128b37Sopenharmony_ci- Synchronous programming model 1661f128b37Sopenharmony_ci 1671f128b37Sopenharmony_ci APIs whose names contain **Sync** are implemented as a synchronous model. When a synchronous API is called, the calling process waits until a value is returned. 1681f128b37Sopenharmony_ci 1691f128b37Sopenharmony_ci The following example opens a file stream in read-only mode, attempts to read the first 4096 bytes, converts them into a UTF-8-encoded string, and then closes the file stream: 1701f128b37Sopenharmony_ci 1711f128b37Sopenharmony_ci ``` 1721f128b37Sopenharmony_ci import fileio from '@OHOS.distributedfile.fileio'; 1731f128b37Sopenharmony_ci 1741f128b37Sopenharmony_ci try { 1751f128b37Sopenharmony_ci var ss = fileio.createStreamSync("tmp", "r") 1761f128b37Sopenharmony_ci buf = new ArrayBuffer(4096) 1771f128b37Sopenharmony_ci ss.readSync(buf) 1781f128b37Sopenharmony_ci console.log(String.fromCharCode.apply(null, new Uint8Array(buf))) 1791f128b37Sopenharmony_ci ss.closeSync() 1801f128b37Sopenharmony_ci } 1811f128b37Sopenharmony_ci catch (e) { 1821f128b37Sopenharmony_ci console.log(e); 1831f128b37Sopenharmony_ci } 1841f128b37Sopenharmony_ci ``` 1851f128b37Sopenharmony_ci 1861f128b37Sopenharmony_ci 1871f128b37Sopenharmony_ci 1881f128b37Sopenharmony_ci 1891f128b37Sopenharmony_ci- Asynchronous programming model: Callback 1901f128b37Sopenharmony_ci 1911f128b37Sopenharmony_ci In the **@OHOS.distributedfile.fileio** module, the APIs whose names do not contain **Sync** and to which a callback is directly passed as their input parameter are implemented as the callback asynchronous model. The callback asynchronous model is also one of the OHOS standard asynchronous models. When an asynchronous API with a callback passed is called, the API executes the concerned task asynchronously and returns the execution result as the input parameters of the registered callback. The first parameter is of the **undefined** or **Error** type, indicating that the execution succeeds or fails, respectively. 1921f128b37Sopenharmony_ci 1931f128b37Sopenharmony_ci The following example creates a file stream asynchronously, reads the first 4096 bytes of the file asynchronously in the callback invoked when the file stream is created, and then closes the file asynchronously in the callback invoked when the file is read: 1941f128b37Sopenharmony_ci 1951f128b37Sopenharmony_ci ``` 1961f128b37Sopenharmony_ci import fileio from '@OHOS.distributedfile.fileio'; 1971f128b37Sopenharmony_ci 1981f128b37Sopenharmony_ci try { 1991f128b37Sopenharmony_ci fileio.createStream("./testdir/test_stream.txt", "r", function (err, ss) { 2001f128b37Sopenharmony_ci if (!err) { 2011f128b37Sopenharmony_ci ss.read(new ArrayBuffer(4096), {}, function (err, buf, readLen) { 2021f128b37Sopenharmony_ci if (!err) { 2031f128b37Sopenharmony_ci console.log('readLen: ' + readLen) 2041f128b37Sopenharmony_ci console.log('data: ' + String.fromCharCode.apply(null, new Uint8Array(buf))) 2051f128b37Sopenharmony_ci } else { 2061f128b37Sopenharmony_ci console.log('Cannot read from the stream ' + err) 2071f128b37Sopenharmony_ci } 2081f128b37Sopenharmony_ci ss.close(function (err) { 2091f128b37Sopenharmony_ci console.log(`Stream is ${err ? 'not' : ''}closed`) 2101f128b37Sopenharmony_ci }); 2111f128b37Sopenharmony_ci }) 2121f128b37Sopenharmony_ci } else { 2131f128b37Sopenharmony_ci console.log('Cannot open the stream ' + err) 2141f128b37Sopenharmony_ci } 2151f128b37Sopenharmony_ci }) 2161f128b37Sopenharmony_ci } catch (e) { 2171f128b37Sopenharmony_ci console.log(e) 2181f128b37Sopenharmony_ci } 2191f128b37Sopenharmony_ci ``` 2201f128b37Sopenharmony_ci 2211f128b37Sopenharmony_ci 2221f128b37Sopenharmony_ci- Asynchronous programming model: Legacy 2231f128b37Sopenharmony_ci 2241f128b37Sopenharmony_ci All APIs in the **@system.file** module are implemented as the legacy asynchronous model. When calling such an API, you need to implement three callbacks \(including **success**, **fail**, and **complete**\) to be invoked when the execution is successful, fails, or is complete, respectively. If the input parameters are correct, the API calls the **success** or **fail** callback based on whether the asynchronous task is successful after the task execution is complete, and finally calls the **complete** callback. 2251f128b37Sopenharmony_ci 2261f128b37Sopenharmony_ci The following example asynchronously checks whether the file pointed to by the specified URI exists and provides three callbacks to print the check result: 2271f128b37Sopenharmony_ci 2281f128b37Sopenharmony_ci ``` 2291f128b37Sopenharmony_ci import file from '@system.file' 2301f128b37Sopenharmony_ci 2311f128b37Sopenharmony_ci file.access({ 2321f128b37Sopenharmony_ci uri: 'internal://app/test.txt', 2331f128b37Sopenharmony_ci success: function() { 2341f128b37Sopenharmony_ci console.log('call access success.'); 2351f128b37Sopenharmony_ci }, 2361f128b37Sopenharmony_ci fail: function(data, code) { 2371f128b37Sopenharmony_ci console.error('call fail callback fail, code: ' + code + ', data: ' + data); 2381f128b37Sopenharmony_ci }, 2391f128b37Sopenharmony_ci complete: function () { 2401f128b37Sopenharmony_ci console.log('call access finally.'); 2411f128b37Sopenharmony_ci } 2421f128b37Sopenharmony_ci }); 2431f128b37Sopenharmony_ci 2441f128b37Sopenharmony_ci console.log("file access tested done") 2451f128b37Sopenharmony_ci ``` 2461f128b37Sopenharmony_ci 2471f128b37Sopenharmony_ci 2481f128b37Sopenharmony_ci## Repositories Involved<a name="section178mcpsimp"></a> 2491f128b37Sopenharmony_ci 2501f128b37Sopenharmony_ci- [**distributeddatamgr_file**](https://gitee.com/openharmony/distributeddatamgr_file) 2511f128b37Sopenharmony_ci- [filemanagement_dfs_service](https://gitee.com/openharmony/filemanagement_dfs_service) 2521f128b37Sopenharmony_ci- [filemanagement_user_file_service](https://gitee.com/openharmony/filemanagement_user_file_service) 2531f128b37Sopenharmony_ci- [filemanagement_storage_service](https://gitee.com/openharmony/filemanagement_storage_service) 2541f128b37Sopenharmony_ci- [filemanagement_app_file_service](https://gitee.com/openharmony/filemanagement_app_file_service) 2551f128b37Sopenharmony_ci 256