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 LAA16008; Sat, 22 Mar 2003 11:59:57 +0100 (MET) 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 LAA16217 for ; Sat, 22 Mar 2003 11:59:56 +0100 (MET) Received: from mail.adept.co.za (mail.adept.co.za [196.44.32.39]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h2MAxrX11163 for ; Sat, 22 Mar 2003 11:59:54 +0100 (MET) Received: from localhost (localhost [127.0.0.1]) by mail.adept.co.za (Postfix) with ESMTP id D84771DB12E for ; Sat, 22 Mar 2003 13:00:15 +0200 (SAST) Received: from spyker (135.dialup.adept.za.net [196.44.32.135]) by mail.adept.co.za (Postfix) with ESMTP id 142B61DB439 for ; Sat, 22 Mar 2003 13:00:15 +0200 (SAST) Received: from js by spyker with local (Exim 3.35 #1 (Debian)) id 18wgj6-0000b4-00 for ; Sat, 22 Mar 2003 12:59:48 +0200 Date: Sat, 22 Mar 2003 10:18:32 +0200 From: Johann Spies To: caml-list@inria.fr Subject: [Caml-list] Unix.stats? Message-ID: <20030322081832.GA1255@adept.co.za> Mail-Followup-To: Johann Spies , caml-list@inria.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Virus-Scanned: Amavis X-Spam: no; 0.00; johann:01 spies:01 jhspies:01 adept:01 unix's:01 -rw-r--r--:01 symlink:01 774:99 420:99 gid:99 0336:01 posbus:01 4668,:01 tygervallei:01 lights:99 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I am trying to build an Ocaml function which can produce the same result as Unix's "find -f f" and when my function started to go into an endless loop I found the following: Consider the following: -rw-r--r-- 2 js js 186322944 Mar 21 23:53 3 -rw-r--r-- 2 js js 186322944 Mar 21 23:53 1 lrwxrwxrwx 1 js js 1 Mar 22 00:26 2 -> 1 1 is the original text file. 2 a symlink 3 a hardlink # Unix.stat "/tmp/2";; - : Unix.stats = {Unix.st_dev = 774; Unix.st_ino = 459846; Unix.st_kind = Unix.S_REG; Unix.st_perm = 420; Unix.st_nlink = 1; Unix.st_uid = 1000; Unix.st_gid = 1000; Unix.st_rdev = 0; Unix.st_size = 186322944; Unix.st_atime = 1048284710; Unix.st_mtime = 1048283603; Unix.st_ctime = 1048283603} # Unix.stat "/tmp/3";; - : Unix.stats = {Unix.st_dev = 774; Unix.st_ino = 459846; Unix.st_kind = Unix.S_REG; Unix.st_perm = 420; Unix.st_nlink = 2; Unix.st_uid = 1000; Unix.st_gid = 1000; Unix.st_rdev = 0; Unix.st_size = 186322944; Unix.st_atime = 1048284710; Unix.st_mtime = 1048283603; Unix.st_ctime = 1048285609} Why did Unix.stat.Unix.st_kind not show Unix.S_LNK ? I am using Ocaml 3.04 in this case. And how do I get it to recognize the link? Regards. Johann -- J.H. Spies - Tel. 021-982 2694 / 082 782 0336 / 021-808 4036(w) Posbus 4668, Tygervallei 7536 "Every good gift and every perfect gift is from above, coming down from the Father of the heavenly lights, who does not change like shifting shadows." James 1:17 ------------------- 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