Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* getlogin : no such file or directory ??
@ 2007-04-12  8:50 Pietro Abate
  2007-04-12 12:06 ` [Caml-list] " Brian E. Aydemir
  0 siblings, 1 reply; 2+ messages in thread
From: Pietro Abate @ 2007-04-12  8:50 UTC (permalink / raw)
  To: ocaml ml

Hi all,
why the Unix.getlogin function returns "no such file or directory"
if the unix getlogin() function returns null (see getlogin.c) ? 

ex:
-----------
let main () =
  try
      print_string (Unix.getlogin())
  with Unix.Unix_error(e,_,_) ->
      failwith (Unix.error_message e)
;;

main ()
---------

echo "a" | ./a.out
Fatal error: exception Failure(No such file or directory")

How can I use getlogin if I want to pass something on the standard input
to my program ? 

The same example works with MacOsX. Why this difference ?

:)
p

-- 
++ Blog: http://blog.rsise.anu.edu.au/?q=pietro
++ 
++ "All great truths begin as blasphemies." -George Bernard Shaw
++ Please avoid sending me Word or PowerPoint attachments.
   See http://www.fsf.org/philosophy/no-word-attachments.html


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-04-12 12:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-12  8:50 getlogin : no such file or directory ?? Pietro Abate
2007-04-12 12:06 ` [Caml-list] " Brian E. Aydemir

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox