Module("system/posix-xsi/file",[Strategies([SDefNoArgs("new-temp-file",Seq(BA(CallNoArgs(SVar("conc-strings")),NoAnnoList(Tuple([RootApp(CallNoArgs(SVar("temp-dir"))),NoAnnoList(Str("\"/StrategoXT\""))]))),CallNoArgs(SVar("mkstemp")))),SDefNoArgs("new-temp-dir",Seq(BA(CallNoArgs(SVar("conc-strings")),NoAnnoList(Tuple([RootApp(CallNoArgs(SVar("temp-dir"))),NoAnnoList(Str("\"/StrategoXT\""))]))),CallNoArgs(SVar("mkdtemp"))))]),Strategies([SDefNoArgs("temp-dir",LChoice(BA(CallNoArgs(SVar("getenv")),NoAnnoList(Str("\"TMPDIR\""))),CallNoArgs(SVar("P_tmpdir")))),SDefNoArgs("P_tmpdir",PrimNoArgs("\"SSL_P_tmpdir\"")),SDefNoArgs("mkstemp",LChoice(Seq(AM(BA(CallNoArgs(SVar("conc-strings")),NoAnnoList(Tuple([RootApp(Id),NoAnnoList(Str("\"XXXXXX\""))]))),Var("template")),Prim("\"SSL_mkstemp\"",[Var("template")])),BA(Seq(CallNoArgs(SVar("perror")),Fail),NoAnnoList(Str("\"SSL/mkstemp\""))))),SDefNoArgs("mkdtemp",LChoice(Seq(AM(BA(CallNoArgs(SVar("conc-strings")),NoAnnoList(Tuple([RootApp(Id),NoAnnoList(Str("\"XXXXXX\""))]))),Var("template")),Prim("\"SSL_mkdtemp\"",[Var("template")])),BA(Seq(CallNoArgs(SVar("perror")),Fail),NoAnnoList(Str("\"SSL/mkdtemp\"")))))]),Strategies([SDefNoArgs("rename-file",Seq(Match(NoAnnoList(Tuple([Var("oldname"),Var("newname")]))),LChoice(Prim("\"SSL_rename\"",[Var("oldname"),Var("newname")]),GuardedLChoice(AM(CallNoArgs(SVar("get-last-error")),NoAnnoList(Op("ErrorNumber",[App(CallNoArgs(SVar("EXDEV")),NoAnnoList(Tuple([])))]))),Seq(BA(CallNoArgs(SVar("copy-file")),NoAnnoList(Tuple([Var("oldname"),Var("newname")]))),BA(CallNoArgs(SVar("remove-file")),Var("oldname"))),Fail)))),SDefNoArgs("copy-file",Seq(Match(NoAnnoList(Tuple([Var("oldname"),Var("newname")]))),Seq(Where(AM(CondChoice(BA(Seq(CallNoArgs(SVar("file-exists")),Seq(CallNoArgs(SVar("filemode")),CallNoArgs(SVar("isdir")))),Var("newname")),BA(CallNoArgs(SVar("concat-strings")),NoAnnoList(List([Var("newname"),NoAnnoList(Str("\"/\"")),App(CallNoArgs(SVar("base-filename")),Var("oldname"))]))),Build(Var("newname"))),Var("newname'"))),Prim("\"SSL_copy\"",[Var("oldname"),Var("newname'")])))),SDefNoArgs("fdcopy",Seq(Match(NoAnnoList(Tuple([Var("fdin"),Var("fdout")]))),Prim("\"SSL_fdcopy\"",[Var("fdin"),Var("fdout")])))])])
