1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859(** Defines types used by file-systems. *)typepath=stringtypeerror=|Already_existsofExn.Backend.t|Not_foundofExn.Backend.t|Permission_deniedofExn.Backend.t|File_too_largetypeExn.err+=Eoferrorleterre=Exn.create(Ee)let()=Exn.register_pp(funf->function|Ee->Fmt.stringf"Fs ";beginmatchewith|Already_existse->Fmt.pff"Already_exists %a"Exn.Backend.ppe|Not_founde->Fmt.pff"Not_found %a"Exn.Backend.ppe|Permission_deniede->Fmt.pff"Permission_denied %a"Exn.Backend.ppe|File_too_large->Fmt.pff"File_too_large"end;true|_->false)(** When to create a new file. *)typecreate=[|`Never(** fail if the named file doesn't exist *)|`If_missingofFile.Unix_perm.t(** create if file doesn't already exist *)|`Or_truncateofFile.Unix_perm.t(** any existing file is truncated to zero length *)|`ExclusiveofFile.Unix_perm.t(** always create; fail if the file already exists *)](** If a new file is created, the given permissions are used for it. *)(** Note: use the functions in {!Path} to access directories. *)classvirtualdir=object(_:#Generic.t)methodprobe_=Nonemethodvirtualopen_in:sw:Switch.t->path-><File.ro;Flow.close>methodvirtualopen_out:sw:Switch.t->append:bool->create:create->path-><File.rw;Flow.close>methodvirtualmkdir:perm:File.Unix_perm.t->path->unitmethodvirtualopen_dir:sw:Switch.t->path->dir_with_closemethodvirtualread_dir:path->stringlistmethodvirtualunlink:path->unitmethodvirtualrmdir:path->unitmethodvirtualrename:path->dir->path->unitmethodvirtualpp:Format.formatter->unitendandvirtualdir_with_close=object(_:<Generic.close;..>)(* This dummy class avoids an "Error: The type < .. > is not an object type" error from the compiler. *)inheritdirend