Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/system/smlnj/installer/libinstall.sml
ViewVC logotype

Diff of /sml/trunk/src/system/smlnj/installer/libinstall.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1615, Fri Aug 27 22:21:00 2004 UTC revision 1616, Mon Aug 30 22:54:16 2004 UTC
# Line 78  Line 78 
78      fun mkdir "" = ()      fun mkdir "" = ()
79        | mkdir d = if fexists d then () else (mkdir (P.dir d); F.mkDir d)        | mkdir d = if fexists d then () else (mkdir (P.dir d); F.mkDir d)
80    
81        (* generalized F.rename that works across different file systems *)
82        fun rename { old, new } =
83            let fun copy () =
84                    let val ins = BinIO.openIn old
85                        val outs = BinIO.openOut new
86                        fun loop () =
87                            let val v = BinIO.input ins
88                            in
89                                if Word8Vector.length v = 0 then
90                                    (BinIO.closeIn ins;
91                                     BinIO.closeOut outs)
92                                else (BinIO.output (outs, v);
93                                      loop ())
94                            end
95                    in
96                        loop ()
97                    end
98            in
99                F.rename { old = old, new = new }
100                handle _ =>
101                       (* probably on different filesys *)
102                       (copy (); rmfile old)
103            end
104    
105      (* move a stable library file to its final location *)      (* move a stable library file to its final location *)
106      fun movelib src dst () =      fun movelib src dst () =
107          (mkdir (P.dir dst); F.rename { old = src, new = dst })          (mkdir (P.dir dst); rename { old = src, new = dst })
108    
109      (* register a temporary anchor-value binding *)      (* register a temporary anchor-value binding *)
110      fun localanchor { anchor, path } =      fun localanchor { anchor, path } =
# Line 325  Line 349 
349                   F.chDir treedir;                   F.chDir treedir;
350                   if OS.Process.system buildcmd = OS.Process.success then                   if OS.Process.system buildcmd = OS.Process.success then
351                       if fexists targetheaploc then                       if fexists targetheaploc then
352                           (F.rename { old = targetheaploc,                           (rename { old = targetheaploc,
353                                       new = finalheaploc };                                       new = finalheaploc };
354                            instcmd target;                            instcmd target;
355                            #set (CM.Anchor.anchor target) (SOME bindir))                            #set (CM.Anchor.anchor target) (SOME bindir))

Legend:
Removed from v.1615  
changed lines
  Added in v.1616

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0