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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/nrrd/run-dnorm_sml.in
ViewVC logotype

Diff of /branches/vis12/src/compiler/nrrd/run-dnorm_sml.in

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

revision 2429, Wed Sep 18 20:05:57 2013 UTC revision 2430, Thu Sep 19 21:41:27 2013 UTC
# Line 3  Line 3 
3   * COPYRIGHT (c) 2012 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 teem command "unu dnorm" on a nrrd file.
7   *)   *)
8    
9  structure RunDNorm : sig  structure RunDNorm : sig
# Line 17  Line 17 
17    
18      structure SS = Substring      structure SS = Substring
19    
   (* search path for the dnorm executable *)  
     val paths = [  
             "@DIDEROT_ROOT@/bin", "@prefix@/bin"  
           ]  
   
     fun findExe () = (case PathUtil.findExe paths "dnorm"  
            of SOME cmd => cmd  
             | NONE => raise Fail "unable to find dnorm executable"  
           (* end case *))  
   
20      fun run srcFile = if OS.FileSys.access(srcFile, [OS.FileSys.A_READ])      fun run srcFile = if OS.FileSys.access(srcFile, [OS.FileSys.A_READ])
21            then let            then let
22              val proc = Unix.execute (findExe(), ["-h", "-i", srcFile])              val unuCmd = OS.Path.concat(Paths.teemBin(), "unu")
23                val proc = Unix.execute (unuCmd, ["dnorm", "-h", "-i", srcFile])
24              val inS = Unix.textInstreamOf proc              val inS = Unix.textInstreamOf proc
25              fun stripWS ss = SS.string (SS.dropl Char.isSpace (SS.dropr Char.isSpace ss))              fun stripWS ss = SS.string (SS.dropl Char.isSpace (SS.dropr Char.isSpace ss))
26              fun read content = (case TextIO.inputLine inS              fun read content = (case TextIO.inputLine inS

Legend:
Removed from v.2429  
changed lines
  Added in v.2430

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