caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Florent Monnier <monnier.florent@gmail.com>
To: Adrien Nader <adrien@notk.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Re: portable truncate
Date: Sat, 27 Jul 2013 16:11:04 +0200	[thread overview]
Message-ID: <CAE1DttDN2F2Xea0Rw3fTnJ6YnWypXkOfYWhq9eq3Qv0zU2Vz5Q@mail.gmail.com> (raw)
In-Reply-To: <20130727083844.GA17235@notk.org>

2013/07/27, Adrien Nader wrote:
> On Fri, Jul 26, 2013, Florent Monnier wrote:
[...]
>> I'm still not sure though that compiling with MSVC or MinGW can be
>> considered equivalent.
>> And actually they seem not considering this page:
>> [2] http://caml.inria.fr/ocaml/portability.en.html
>
> The compiler differs but otherwise the differences are small.

I have already understood that MinGW will produce a resulting binary
that equivalently makes use of MS' OS libs. But as far as I have
understood it also provide an additional layer which goal is to make
easier to compile something that comes from the Unix world. As a
result I expected to get a fully functional ocaml Unix module.


>                                                               The libc
> that is used on Windows is Microsoft's (actually called CRT); mingw*
> provide some additions to that and apparently, ftruncate is provided.

- truncate()  DOES work on my computer
- ftruncate() / _chsize()  DOESN'T


> In otherlibs/win32unix/unix.ml, you have:
>   let ftruncate fd len = invalid_arg "Unix.ftruncate not implemented"

I see,
I expected that a mingw variant would use "otherlibs/unix/"
So it seems I was wrong again on that point too.

> And in unistd.h, you have:
[...]
>   __CRT_INLINE int ftruncate(int __fd, off32_t __length)
>   {
>     return _chsize (__fd, __length);
>   }
[...]
> Considering this, you should probably make a patch to add a file
> win32unix/ftruncate.c which use the implementation above and replace the
> implementation of ftruncate* in win32unix/unix.ml.

Don't you think that "win32unix/" should remain as is for the MS
compiler, and that mingw variant should just switch to
"otherlibs/unix/" ?

> I don't know what is the purpose of the __CRT_NO_INLINE define; I've
> already asked and will propagate the answer when I get it. It would be
> good to have truncate*() too.
>
> (and submit it to the bug tracker :-) )

I do have only one test machine with Windows Seven Starter to make
tests. And I do not have the MS' compiler.

Are there other people arround living in Rennes (the town where I
live) that would accept to provide me access to other test machines
under MS/Windows ? Like for example Windows 8 ?
(So that I could do more serious tests.)

I would be interested to access Mac OS X too, also for portability works.
(Someone from the lug gave me a Mac in the past to make some
portability work, but this machine is too old now for this kind of
tasks.)

-- 
Regards

  parent reply	other threads:[~2013-07-27 14:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-26 10:35 [Caml-list] " Florent Monnier
2013-07-26 10:46 ` Mihamina Rakotomandimby
2013-07-26 10:48   ` Török Edwin
2013-07-26 10:52 ` Daniel Bünzli
2013-07-26 12:02 ` [Caml-list] " Florent Monnier
2013-07-27  7:05   ` David Allsopp
2013-07-27  8:54     ` Florent Monnier
2013-07-27  8:38   ` Adrien Nader
2013-07-27  9:05     ` Adrien Nader
2013-07-27 14:11     ` Florent Monnier [this message]
2013-07-27 14:23       ` Adrien Nader
2013-07-27 15:34         ` Florent Monnier
2013-07-27 15:43           ` Adrien Nader
2013-07-27 19:45             ` Florent Monnier
2013-07-27 19:53               ` Adrien Nader
2013-07-27 20:03                 ` Török Edwin
     [not found] ` <20130727181711.65d8456f@kiwi.local.tld>
2013-07-27 14:41   ` [Caml-list] " Florent Monnier
2013-07-27 15:26     ` Adrien Nader
2013-07-27 15:40       ` Florent Monnier

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=CAE1DttDN2F2Xea0Rw3fTnJ6YnWypXkOfYWhq9eq3Qv0zU2Vz5Q@mail.gmail.com \
    --to=monnier.florent@gmail.com \
    --cc=adrien@notk.org \
    --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).