From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id CC724BC69 for ; Thu, 12 Apr 2007 10:50:16 +0200 (CEST) Received: from mail.rsise.anu.edu.au (mail.rsise.anu.edu.au [150.203.208.4]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3C8oC7k020833 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 12 Apr 2007 10:50:16 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id 6D1905459F for ; Thu, 12 Apr 2007 18:50:10 +1000 (EST) Received: from mail.rsise.anu.edu.au ([150.203.208.4]) by localhost (mail [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 32381-10 for ; Thu, 12 Apr 2007 18:50:10 +1000 (EST) Received: from pulp.rsise.anu.edu.au (pulp.rsise.anu.edu.au [150.203.208.49]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id 549EC53D7A for ; Thu, 12 Apr 2007 18:50:07 +1000 (EST) Received: by pulp.rsise.anu.edu.au (Postfix, from userid 1560) id A2492A0AFC7; Thu, 12 Apr 2007 18:50:07 +1000 (EST) Date: Thu, 12 Apr 2007 18:50:07 +1000 From: Pietro Abate To: ocaml ml Subject: getlogin : no such file or directory ?? Message-ID: <20070412085007.GA9614@pulp.rsise.anu.edu.au> Mail-Followup-To: Pietro Abate , ocaml ml MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: GNU/Linux X-Organization: Research School of Information Science and Engineering (Australian National University) User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at mail.rsise.anu.edu.au X-Miltered: at concorde with ID 461DF2C4.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; failwith:01 blog:98 blog:98 unix:01 unix:01 macosx:01 exception:01 philosophy:02 string:02 let:03 null:05 echo:05 standard:07 function:08 function:08 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