Properly check glProgramStringARB for failures
[dormin.git] / slice.ml
blob411f76e9409bb3f9ba97f8cc5ac3d759ca6e1d65
1 let slice = ref `none
3 let add name data =
4 match !slice with
5 | `none -> ()
6 | `oc oc ->
7 Format.printf "adding %s@." name;
8 output_char oc '\000';
9 output_string oc name;
10 output_char oc '\000';
11 output_string oc data;
12 | `dir dir ->
13 let oc = open_out_bin (Filename.concat dir name) in
14 output_string oc data;
15 close_out oc
18 let is_directory path =
19 try (Unix.stat path).Unix.st_kind = Unix.S_DIR with _ -> false
22 let openslice name =
23 if is_directory name
24 then
25 slice := `dir name
26 else
27 let oc = open_out_bin name in
28 slice := `oc oc;