Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /trunk/src/compiler/fields/run-dnorm_sml.in
ViewVC logotype

Diff of /trunk/src/compiler/fields/run-dnorm_sml.in

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

revision 2358, Sun Apr 7 15:17:59 2013 UTC revision 2359, Sun Apr 7 16:31:38 2013 UTC
# Line 1  Line 1 
1  (* run-dnorm_sml.in  (* run-dnorm_sml.in
2   *   *
3   * COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)   * COPYRIGHT (c) 2012 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4   * All rights reserved.   * All rights reserved.
5   *   *
6   * This module supports running the dnorm program on a nrrd file.   * This module supports running the dnorm program on a nrrd file.
# Line 22  Line 22 
22              "@DIDEROT_ROOT@/bin", "@prefix@/bin"              "@DIDEROT_ROOT@/bin", "@prefix@/bin"
23            ]            ]
24    
25  (* FIXME: with SML/NJ 110.73, we'll be able to use PathUtil.findExe *)      fun findExe () = (case PathUtil.findExe paths "dnorm"
     fun findExe () = let  
           fun isExe p = OS.FileSys.access(p, [OS.FileSys.A_EXEC])  
           in  
             case PathUtil.existsFile isExe paths "dnorm"  
26               of SOME cmd => cmd               of SOME cmd => cmd
27                | NONE => raise Fail "unable to find dnorm executable"                | NONE => raise Fail "unable to find dnorm executable"
28              (* end case *)            (* end case *))
           end  
29    
30      fun run srcFile = if OS.FileSys.access(srcFile, [OS.FileSys.A_READ])      fun run srcFile = if OS.FileSys.access(srcFile, [OS.FileSys.A_READ])
31            then let            then let
# Line 61  Line 56 
56                  else raise Fail "error running dnorm"                  else raise Fail "error running dnorm"
57              end              end
58            else raise Fail(concat["image file \"", srcFile, "\" not found"])            else raise Fail(concat["image file \"", srcFile, "\" not found"])
59    
60    end    end

Legend:
Removed from v.2358  
changed lines
  Added in v.2359

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