rox has quit [Read error: 54 (Connection reset by peer)]
rox has joined #ocaml
lament has quit [Remote closed the connection]
mattam_ has quit ["zZz"]
<pattern_>
how would i go about parsing the output of a shell command i had run with Unix.system ?
foxster has quit [Read error: 104 (Connection reset by peer)]
mellum has quit ["zzZ"]
lament has joined #ocaml
TachYon has joined #ocaml
TachYon has quit [Remote closed the connection]
rox is now known as rox|unternehmen
systems has joined #ocaml
systems has quit ["Client Exiting"]
det has joined #ocaml
Kinners has joined #ocaml
<pattern_>
when i use Unix.chdir to change directories it works while the program is running, but as soon as the program quits i am back in my starting directory
<pattern_>
is there any way to change directories such that that's the directory i'll find myself in when my program quits?
lament has quit [Remote closed the connection]
<det>
pattern_, probally not
<det>
pattern_, you'd have to tell the shell to change directories somehow
<pattern_>
hmm... maybe Unix.system "cd .." will work
<pattern_>
but i doubt it
<Kinners>
you can't really change the enviroment of a different process
<pattern_>
well, that's ok... i can live without it
<pattern_>
thanks, det & kinners
<Kinners>
one way is to write a shell script that does something like cd `foobar`, where foobar prints out a dirname, and run the script as '. /path/to/myscript'
<pattern_>
yeah, i thought of that
<pattern_>
but the problem is that my program may print other things too
<pattern_>
in which case it'll fuck up cd
<pattern_>
i guess maybe there's a way to print the dir to cd to on a special filehandle reserved especially for cd to read from
<Kinners>
are you using stderr?
<pattern_>
yeah, stderr would be one possibility
<pattern_>
but i think it's also possible to leave stderr and stdout both free and go for yet another filedescriptor
<pattern_>
and then my script would check for output on that special filedescriptor and if there is output cd there, and not cd otherwise
<Kinners>
or just write it to a temporary file
<pattern_>
yeah, that's a good idea too
<pattern_>
or i can create a socket and read it from there ;)
lament has joined #ocaml
foxster has joined #ocaml
<pattern_>
$ cat foo.ml
<pattern_>
(* " *)
<pattern_>
$ ocamlc -c -pp camlp4o -g foo.ml
<pattern_>
File "foo.ml", line 1, characters 0-8:
<pattern_>
Lexing error: string not terminated
<pattern_>
Preprocessor error
<pattern_>
interesting that it would balk at an unterminated string within a comment
det has quit ["ircII EPIC4-1.1.2 -- Are we there yet?"]
lament is now known as Rohan
Rohan is now known as lament
mattam has joined #ocaml
xxd has joined #ocaml
foxster has quit [Read error: 104 (Connection reset by peer)]
Kinners has left #ocaml []
lament has quit ["Did you know that God's name is ERIS, and that He is a girl?"]
musasabi has quit [adams.freenode.net irc.freenode.net]
musasabi has joined #ocaml
TachYon76 has joined #ocaml
TachYon76 has quit [Remote closed the connection]
Kinners has joined #ocaml
skylan has quit [Read error: 54 (Connection reset by peer)]
skylan has joined #ocaml
Yurik has joined #ocaml
rox|unternehmen is now known as rox
taw has joined #ocaml
<Yurik>
taw: hi
<taw>
hi
<taw>
hehe
<taw>
my articles about ocamllex and ocamlyacc on polish wikipedia are on top in google search ;)