jemfinch` changed the topic of #ocaml to: nob: it's not an option keyword. It's a datatype. 'a option. It can be either "None" or "Some data" -- it represents either data that's not there (None) or data that's there (Some data)
nyoshi has joined #ocaml
jao_ is now known as jao
malc has quit ["no reason"]
Verbed has quit ["Client Exiting"]
nyoshi0 has joined #ocaml
nyoshi has quit [Read error: 104 (Connection reset by peer)]
awwaiid has joined #ocaml
awwaiid has quit [Remote closed the connection]
awwaiid has joined #ocaml
awwaiid has quit [Remote closed the connection]
smkl has quit [Read error: 104 (Connection reset by peer)]
smkl has joined #ocaml
nyoshi0 has quit ["CHOCOA"]
nyoshi has joined #ocaml
nyoshi has quit ["CHOCOA"]
jao has quit [Read error: 113 (No route to host)]
scott has joined #ocaml
<scott> how do I run an external command?
<scott> like just a regular binary in the OS, from ocaml code
Yurik has joined #ocaml
vect- has joined #ocaml
vect- is now known as gl
Cryptor has joined #ocaml
malc has joined #ocaml
graydon has quit [Read error: 110 (Connection timed out)]
Cryptor has quit ["Leaving"]
<smkl> scott: try Sys.command
malc has quit ["no reason"]
Yurik has quit ["reboot"]
gl has quit ["Sic transit gloria mundi"]
graydon has joined #ocaml
owll has joined #ocaml
Tian has joined #ocaml
Tian has quit ["Client Exiting"]
Submarine has joined #ocaml
<Submarine> hi
<smkl> hello
<Submarine> We have just optimized a program 7x by taking advantage of some data structures.
<Submarine> It turns out that addings a few == checks for trivial results in well chosen places can give a tremendous performance boost by not requiring unneccessary computations.
owll has quit ["Client Exiting"]
jao has joined #ocaml
malc has joined #ocaml
<tmcm> does anyone see anything obviously wrong with this:
<tmcm> let batch_pgp signed clear pgplog =
<tmcm> let oin = openfile signed [O_RDONLY] 0
<tmcm> and oout = openfile clear [O_WRONLY; O_CREAT] 0o600 in
<tmcm> dup2 oin stdin; close oin;
<tmcm> dup2 oout stdout; close oout;
<tmcm> dup2 pgplog stderr; close pgplog;
<tmcm> try
<tmcm> execvp "pgp" [| "pgp"; "+batchmode=on"; "+verbose=0"; "-f" |]
<tmcm> with
<tmcm> Unix_error(e, _, _) ->
<tmcm> Printf.eprintf "%s\n" (Unix.error_message e);
<tmcm> flush Pervasives.stderr;
<tmcm> exit 1
<tmcm> it fails compilation with:
<tmcm> File "appsys/pgp.ml", line 47, characters 12-20:
<tmcm> This function is applied to too many arguments
<tmcm> line 47 is:
<tmcm> let oin = openfile signed [O_RDONLY] 0
<Submarine> Where is openfile defined?
<tmcm> val openfile : options list -> string
<tmcm> val openfile : string -> open_flag list -> file_perm -> file_descr
<tmcm> (* Open the named file with the given flags. Third argument is
<tmcm> the permissions to give to the file if it is created. Return
<tmcm> a file descriptor on the named file. *)
<Submarine> It's in module Unix, right?
<tmcm> it's in a module called safe
<malc> tmcm: are you sure that something doesnt shadow orignal(needed) openfile?
Submarine has quit ["Client Exiting"]
<tmcm> no, i'm not sure
<tmcm> in fact, i think that may be what's happening
<malc> and where did you get <tmcm> val openfile : options list -> string <- this
<tmcm> safe418.mli:val openfile : options list -> string
<tmcm> safe418.mli:val openfile : string -> open_flag list -> file_perm -> file_descr
<tmcm> safetk.mli:val openfile : options list -> string
<tmcm> safeunix.mli:val openfile : string -> open_flag list -> file_perm -> file_descr
<tmcm> i think that's my problem
<tmcm> (sorry, i'm an ML neophyte)
<smkl> try using Safeunix.openfile
<malc> yep using fully qualified name will do the trick
<malc> unless you seriously fucked it up inside safeunix
<tmcm> i changed the order of the includes
<tmcm> it's compiling now
<tmcm> thanks
owll has joined #ocaml
owll has quit ["Client Exiting"]