English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Curious about Unix.readdir and ls
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-05-24 (02:22)
From: Blair Zajac <blair@o...>
Subject: Re: [Caml-list] Curious about Unix.readdir and ls
Jens Olsson wrote:
> Hello,
> I was wondering.... when doing Unix.readdir on an Emacs backup file (like #myfile#), I only get the name #myfile (without ending #). First I thought that was a problem related to the readdir function but obviously it is a little deeper than that:
> When doing 'ls .' on the directory containing the above example file ls seems to have the same problem (at least on my system). The file is printed in flashing red and without the ending #. Or is this as it should? How do I know that?
> BUT, if I let the shell expand a wildcard, it does so correctly: 'ls *' returns a line containing #myfile# and my ocaml program doing readdir gets a correct filename (of course).
> So, what is happening? Anyone who wants to enlighten me? :)
> Jens Olsson

One of the problems sounds like ls showing additional information
about the file.

Use /bin/ls to see the real names of files in the directory with
any additional trailing characters.  This should be the name that
readdir finds.

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