caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Johann Spies <jhspies@adept.co.za>
To: caml-list@inria.fr
Subject: [Caml-list] Unix.stats?
Date: Sat, 22 Mar 2003 10:18:32 +0200	[thread overview]
Message-ID: <20030322081832.GA1255@adept.co.za> (raw)

I am trying to build an Ocaml function which can produce the same
result as Unix's "find <dir> -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


             reply	other threads:[~2003-03-22 10:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-22  8:18 Johann Spies [this message]
2003-03-22 11:10 ` Maxence Guesdon
2003-03-22 11:11 ` Ceri Storey
2003-03-22 12:45   ` Johann Spies

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030322081832.GA1255@adept.co.za \
    --to=jhspies@adept.co.za \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).