Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/domPublic

Commit0a0acde

Browse files
committed
Still load metadata
1 parentfb8ff5a commit0a0acde

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

‎.gitignore‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ docs
44
*.log
55
tmp
66
build
7-
tests/.coverage
7+
tests/.coverage
8+
.tmp.*

‎src/access.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class WebAccessFS extends Async(IndexFS) {
5454
* Loads all of the handles.
5555
*@internal@hidden
5656
*/
57-
async_loadHandles(path:string,handle:FileSystemDirectoryHandle){
57+
protectedasync_loadHandles(path:string,handle:FileSystemDirectoryHandle){
5858
forawait(const[key,child]ofhandle.entries()){
5959
constp=join(path,key);
6060
this._handles.set(p,child);
@@ -67,6 +67,9 @@ export class WebAccessFS extends Async(IndexFS) {
6767
*@internal@hidden
6868
*/
6969
async_loadMetadata(metadataPath?:string):Promise<void>{
70+
this._handles.set('/',this.root);
71+
awaitthis._loadHandles('/',this.root);
72+
7073
if(metadataPath){
7174
consthandle=awaitthis.get('file',metadataPath);
7275
constfile=awaithandle.getFile();
@@ -100,8 +103,7 @@ export class WebAccessFS extends Async(IndexFS) {
100103
){
101104
super(0x77656261,'webaccessfs');
102105
this.attributes.set('no_buffer_resize',true);
103-
if(!disableHandleCache)this._handles.set('/',root);
104-
elsethis.attributes.set('no_handle_cache',true);
106+
if(disableHandleCache)this.attributes.set('no_handle_cache',true);
105107
}
106108

107109
protectedasyncremove(path:string):Promise<void>{
@@ -200,7 +202,7 @@ export class WebAccessFS extends Async(IndexFS) {
200202

201203
if(!this.disableHandleCache){
202204
consthandle=this._handles.get(path);
203-
if(!handle)throwwithErrno('ENODATA');
205+
if(!handle)throwwithErrno('ENOENT');
204206

205207
if(kind&&!isKind(handle,kind))throwwithErrno(kind=='directory' ?'ENOTDIR' :'EISDIR');
206208

@@ -235,9 +237,7 @@ const _WebAccess = {
235237
},
236238

237239
asynccreate(options:WebAccessOptions){
238-
constfs=newWebAccessFS(options.handle,options.disableHandleCache);
239-
if(options.disableHandleCache)returnfs;
240-
awaitfs._loadHandles('/',options.handle);
240+
constfs=newWebAccessFS(options.handle);
241241
awaitfs._loadMetadata(options.metadata);
242242
returnfs;
243243
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp