caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: sylvain.le-gall@polytechnique.org
To: Sebastien Ferre <sbf@aber.ac.uk>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] file copy
Date: Wed, 23 Jun 2004 21:21:07 +0200	[thread overview]
Message-ID: <20040623192107.GD2856@gallu.homelinux.org> (raw)
In-Reply-To: <40D9A7E7.2060703@aber.ac.uk>

On Wed, Jun 23, 2004 at 03:55:19PM +0000, Sebastien Ferre wrote:
> Hi,
> 
> is there any function in OCaml for copying a file
> like with the Unix command 'cp' ? I wish to avoid
> using the function Sys.command to keep platform
> independency.
> I could not find any neither in the standard library,
> nor in the Unix library.
> 
Hello,

You can use the library i am developping : ocaml-fileutils.

It allows you to do 'cp' and a lot of other operation ( 'mv', 'ls', 'find', 'rm'... )

Moreover, you can do cp ~recurse:true to copy whole directory.

Least but not last, all the function should be platform independent,
regarding filename, because it use filePath which is a wrapper for
filename of the platform ( support : Unix, MacOs, Win32, Cygwin style ).

Actually, i am writing unitary test in order to release version 0.3,
which comes with operation on file size ( 'du', + test for find ), loop
prevention ( if you have a symlink from 'x' to '.', it won't recurse ).
It also changes some prototype : rm, cp will now use list as argument.

It also fixes some bugs. This new version will be available friday or
saturday.

Anyway, the current version should be enough for your usage ( and for
two days ).

Kind regard
Sylvain Le Gall

ps : http://www.carva.org/sylvain.le-gall/

-------------------
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


      parent reply	other threads:[~2004-06-23 19:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-23 15:55 Sebastien Ferre
2004-06-23 15:06 ` Maxence Guesdon
2004-06-23 15:20 ` skaller
2004-06-23 16:37 ` padiolea
2004-06-23 19:21 ` sylvain.le-gall [this message]

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=20040623192107.GD2856@gallu.homelinux.org \
    --to=sylvain.le-gall@polytechnique.org \
    --cc=caml-list@inria.fr \
    --cc=sbf@aber.ac.uk \
    /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).