Project

General

Profile

Revision fa090c4e src/main_lustre_compiler.ml

View differences:

src/main_lustre_compiler.ml
228 228
  report ~level:2 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@,@?"
229 229
    (Utils.fprintf_list ~sep:"@ " Machine_code.pp_machine)
230 230
    machine_code);
231

  
231
  
232
  (* Creating destination directory if needed *)
233
  if not (Sys.file_exists !Options.dest_dir) then (
234
    report ~level:1 (fun fmt -> fprintf fmt ".. creating destination directory@,@?");
235
    Unix.mkdir !Options.dest_dir (Unix.stat ".").Unix.st_perm
236
  );
237
  if (Unix.stat !Options.dest_dir).Unix.st_kind <> Unix.S_DIR then (
238
    Format.eprintf "Failure: destination %s is not a directory.@.@." !Options.dest_dir;
239
    exit 1
240
  );
232 241
  (* Printing code *)
233 242
  let basename    =  Filename.basename basename in
234 243
  let destname = !Options.dest_dir ^ "/" ^ basename in

Also available in: Unified diff