}e=he(e);varl,d,p,h,g=ve(e),v=ge(e);o(t,e,i)}functionf(t,e,n){functioni(e,r){e?n(e):(g=r,t.getObject(g.data,a))}functiona(r,i){r?n(r):je==m?n(newke.EBUSY(null,e)):de(i).has(m)?(v=i,p=v[m].id,t.getObject(p,u)):n(newke.ENOENT(null,e))}functionu(r,i){r?n(r):i.mode!=be?n(newke.ENOTDIR(null,e)):(p=i,t.getObject(p.data,s))}functions(t,r){t?n(t):(h=r,de(h).size()>0?n(newke.ENOTEMPTY(null,e)):c())}functionf(e){if(e)n(e);else{vari=Date.now();r(t,E,g,{mtime:i,ctime:i},l)}}functionc(){deletev[m],t.putObject(g.data,v,f)}functionl(e){e?n(e):t.delete(p.id,d)}functiond(e){e?n(e):t.delete(p.data,n)}e=he(e);varp,h,g,v,m=ve(e),E=ge(e);o(t,E,i)}functionc(t,e,n,i){functiona(n,r){n?i(n):r.mode!==be?i(newke.ENOENT(null,e)):(v=r,t.getObject(v.data,u))}functionu(r,o){r?i(r):(m=o,de(m).has(b)?de(n).contains(De)?i(newke.ENOENT("O_CREATE and O_EXCLUSIVE are set, and the named file exists",e)):(E=m[b],E.type==be&&de(n).contains(xe)?i(newke.EISDIR("the named file is a directory and O_WRITE is set",e)):t.getObject(E.id,s)):de(n).contains(Ne)?l():i(newke.ENOENT("O_CREATE is not set and the named file does not exist",e)))}functions(t,n){if(t)i(t);else{varr=n;r.mode==Ie?(O++,O>Ae?i(newke.ELOOP(null,e)):f(r.data)):c(void0,r)}}functionf(r){r=he(r),I=ge(r),b=ve(r),je==b&&(de(n).contains(xe)?i(newke.EISDIR("the named file is a directory and O_WRITE is set",e)):o(t,e,c)),o(t,I,a)}functionc(t,e){t?i(t):(y=e,i(null,y))}functionl(){Ye.create({guid:t.guid,mode:we},function(e,n){returne?(i(e),void0):(y=n,y.nlinks+=1,t.putObject(y.id,y,d),void0)})}functiond(e){e?i(e):(w=newWe(0),w.fill(0),t.putBuffer(y.data,w,h))}functionp(e){if(e)i(e);else{varn=Date.now();r(t,I,v,{mtime:n,ctime:n},g)}}functionh(e){e?i(e):(m[b]=newPe(y.id,we),t.putObject(v.data,m,p))}functiong(t){t?i(t):i(null,y)}e=he(e);varv,m,E,y,w,b=ve(e),I=ge(e),O=0;je==b?de(n).contains(xe)?i(newke.EISDIR("the named file is a directory and O_WRITE is set",e)):o(t,e,c):o(t,I,a)}functionl(t,e,n,i,o,a){functionu(t){t?a(t):a(null,o)}functions(n){if(n)a(n);else{vari=Date.now();r(t,e.path,l,{mtime:i,ctime:i},u)}}functionf(e){e?a(e):t.putObject(l.id,l,s)}functionc(r,u){if(r)a(r);else{l=u;vars=newWe(o);s.fill(0),n.copy(s,0,i,i+o),e.position=o,l.size=o,l.version+=1,t.putBuffer(l.data,s,f)}}varl;t.getObject(e.id,c)}functiond(t,e,n,i,o,a,u){functions(t){t?u(t):u(null,o)}functionf(n){if(n)u(n);else{vari=Date.now();r(t,e.path,p,{mtime:i,ctime:i},s)}}functionc(e){e?u(e):t.putObject(p.id,p,f)}functionl(r,s){if(r)u(r);else{if(h=s,!h)returnu(newke.EIO("Expected Buffer"));varf=void0!==a&&null!==a?a:e.position,l=Math.max(h.length,f+o),d=newWe(l);d.fill(0),h&&h.copy(d),n.copy(d,f,i,i+o),void0===a&&(e.position+=o),p.size=l,p.version+=1,t.putBuffer(p.data,d,c)}}functiond(e,n){e?u(e):(p=n,t.getBuffer(p.data,l))}varp,h;t.getObject(e.id,d)}functionp(t,e,n,r,i,o,a){functionu(t,u){if(t)a(t);else{if(c=u,!c)returna(newke.EIO("Expected Buffer"));vars=void0!==o&&null!==o?o:e.position;i=s+i>n.length?i-s:i,c.copy(n,r,s,s+i),void0===o&&(e.position+=i),a(null,i)}}functions(e,n){e?a(e):(f=n,t.getBuffer(f.data,u))}varf,c;t.getObject(e.id,s)}functionh(t,e,r){e=he(e),ve(e),o(t,e,n(r))}functiong(t,e,r){t.getObject(e.id,n(r))}functionv(t,e,r){functioni(e,n){e?r(e):(u=n,t.getObject(u.data,a))}functiona(i,o){i?r(i):(s=o,de(s).has(f)?t.getObject(s[f].id,n(r)):r(newke.ENOENT("a component of the path does not name an existing file",e)))}e=he(e);varu,s,f=ve(e),c=ge(e);je==f?o(t,e,n(r)):o(t,c,i)}functionm(t,e,n,i){functiona(e){e?i(e):r(t,n,y,{ctime:Date.now()},i)}functionu(e,n){e?i(e):(y=n,y.nlinks+=1,t.putObject(y.id,y,a))}functions(e){e?i(e):t.getObject(E[w].id,u)}functionf(e,n){e?i(e):(E=n,de(E).has(w)?i(newke.EEXIST("newpath resolves to an existing file",w)):(E[w]=v[p],t.putObject(m.data,E,s)))}functionc(e,n){e?i(e):(m=n,t.getObject(m.data,f))}functionl(e,n){e?i(e):(v=n,de(v).has(p)?o(t,b,c):i(newke.ENOENT("a component of either path prefix does not exist",p)))}functiond(e,n){e?i(e):(g=n,t.getObject(g.data,l))}e=he(e);varp=ve(e),h=ge(e);n=he(n);varg,v,m,E,y,w