From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA31675; Wed, 30 Jul 2003 21:17:00 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA32620 for ; Wed, 30 Jul 2003 21:16:59 +0200 (MET DST) Received: from plover.atdesk.com (plover.atdesk.com [204.130.247.254]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h6UJGwT28799 for ; Wed, 30 Jul 2003 21:16:58 +0200 (MET DST) Received: from explicit.atdesk.com (explicit.atdesk.com [172.30.40.54]) by plover.atdesk.com (8.11.6/8.11.6) with ESMTP id h6UJGsm18325 for ; Wed, 30 Jul 2003 15:16:55 -0400 To: Subject: Re: [Caml-list] Reading directory Problem References: <69FB2CA668C6D841BE0326C13071C69FA8D49B@hq-ex2kpo1.filenet.fn.com> From: Chris Uzdavinis Organization: Automated Trading Desk, LLC Date: Wed, 30 Jul 2003 15:16:54 -0400 In-Reply-To: <69FB2CA668C6D841BE0326C13071C69FA8D49B@hq-ex2kpo1.filenet.fn.com> (To Trinh Le's message of "Wed, 30 Jul 2003 11:37:59 -0700") Message-ID: User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 struct:01 readdir:01 posix:01 chris:01 ocaml:01 null:01 writes:01 unix:02 module:03 wrote:03 interface:03 library:03 newsgroup:05 seems:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk "Le, To Trinh" writes: > Hello, > > I have problem with determine directory or file type. I wrote > DIR * dirp; struct dirent *pDirent; > while((pDirent=readdir(dirp)) != NULL) > { > if(pDirent->d_name[0] == '.' continue; This isn't a C newsgroup... but... Ocaml has a function called "stat" (in the Unix module) that can give you this information. Who knows, maybe the stat function is available in the POSIX spec too, with a C interface. It seems that the POSIX people copied the OCAML "Unix" library fairly closely. -- Chris ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners