Re: Equivalent of "du" utility in Unix or Sys module ?

"Matthieu Dubuget [email protected] [ocaml_beginners]" <[email protected]>
Newsgroups gmane.comp.lang.ocaml.beginners
Message-ID <[email protected]>
http://stackoverflow.com/questions/26982027/why-is-open-process-full-not-returning-the-stdout-contents-of-the-externam-proce
http://pleac.sourceforge.net/pleac_ocaml/processmanagementetc.html


Le 21/06/2015 13:23, Doyle Jonathan [email protected] 
[ocaml_beginners] a écrit :
> It is quite possible that this is what I am after, yes. Thank you for 
> your help.
> I have only a nodding acquaintance with the Unix module though.
> I found a link : Unix system programming in OCaml 
> <https://ocaml.github.io/ocamlunix/ocamlunix.html> and I'll read it if 
> I have
> the time. Meanwhile, if anyone has a link more directly related to my 
> specific question,
> I'm interested.
> 	
> image <https://ocaml.github.io/ocamlunix/ocamlunix.html>
> 	
> 	
> 	
> 	
> 	
> Unix system programming in OCaml 
> <https://ocaml.github.io/ocamlunix/ocamlunix.html>
> Unix system programming in OCaml Xavier Leroy and Didier Rémy 
> 1stDecember , 2014 © 1991, 1992, 2003, 2004, 2005, 2006, 2008, 2009, 
> 2010 Xavier Leroy and ...
>
> Afficher sur ocaml.github.io 
> <https://ocaml.github.io/ocamlunix/ocamlunix.html>
> 	
> Aperçu par Yahoo
>
>
>
> ------------------------------------------------------------------------
> *De :* "Matthieu Dubuget [email protected] [ocaml_beginners]" 
> <[email protected]>
> *À :* [email protected]
> *Envoyé le :* Dimanche 21 juin 2015 13h15
> *Objet :* Re: "ocaml_beginners"::[] Equivalent of "du" utility in Unix 
> or Sys module ?
>
> Have a look at Unix.open_process* functions.
>
> I think it is what you are after?
>
> Best regards
>
> Le 21/06/2015 13:09, [email protected] 
> <mailto:[email protected]> [ocaml_beginners] a écrit :
>> In the ocaml interpreter, I can type
>>
>> Sys.command "du -d 1 pathformydirectory ";;
>>
>> to inspect the disk usage in a given directory.
>>
>> The problem is, the result is of type unit and I would prefer a 
>> result of type, say, (string*int) list.
>>
>>  Is there a function from the Unix or Sys module that does this ?
>>
>>
>
> -- 
> Matthieu Dubuget
> Guide d’autodéfense numérique :http://guide.boum.org  <http://guide.boum.org/>
>
>
> 

-- 
Matthieu Dubuget
Guide d’autodéfense numérique : http://guide.boum.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.