12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879(** Note: file-system operations, such as opening or deleting files,
can be found in the {!Path} module. *)openStd(** {2 Types} *)typepath=stringtypeerror=|Already_existsofExn.Backend.t|Not_foundofExn.Backend.t|Permission_deniedofExn.Backend.t|File_too_large|Not_nativeofstring(** Raised by {!Path.native_exn}. *)typeExn.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"|Not_nativem->Fmt.pff"Not_native %S"mend;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. *)typedir_ty=[`Dir]type'adir=([>dir_ty]as'a)r(** Note: use the functions in {!Path} to access directories. *)(** {2 Provider Interface} *)modulePi=structmoduletypeDIR=sigtypetvalopen_in:t->sw:Switch.t->path->File.ro_tyrvalopen_out:t->sw:Switch.t->append:bool->create:create->path->File.rw_tyrvalmkdir:t->perm:File.Unix_perm.t->path->unitvalopen_dir:t->sw:Switch.t->path->[`Close|dir_ty]rvalread_dir:t->path->stringlistvalstat:t->follow:bool->string->File.Stat.tvalunlink:t->path->unitvalrmdir:t->path->unitvalrename:t->path->_dir->path->unitvalread_link:t->path->stringvalpp:tFmt.tvalnative:t->string->stringoptionendtype(_,_,_)Resource.pi+=|Dir:('t,(moduleDIRwithtypet='t),[>dir_ty])Resource.piend