caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Creating a directory with default permissions
@ 2006-10-20 18:43 Martin Jambon
  2006-10-20 19:21 ` [Caml-list] " Gerd Stolpmann
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Jambon @ 2006-10-20 18:43 UTC (permalink / raw)
  To: caml-list

Hello,

Is there a way to write portable OCaml code which creates a directory
with the default permissions as defined by umask?

According to the documentation, Unix.umask is not available under Win32,
yet some functions ask for some file permissions. I don't know much about
Windows, but would there be a problem with having a Win32 Unix.umask
function which initially returns 0?


Thanks,


Martin

--
Martin Jambon, PhD
http://martin.jambon.free.fr


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Creating a directory with default permissions
  2006-10-20 18:43 Creating a directory with default permissions Martin Jambon
@ 2006-10-20 19:21 ` Gerd Stolpmann
  2006-10-20 21:41   ` Martin Jambon
  0 siblings, 1 reply; 3+ messages in thread
From: Gerd Stolpmann @ 2006-10-20 19:21 UTC (permalink / raw)
  To: Martin Jambon; +Cc: caml-list

Am Freitag, den 20.10.2006, 11:43 -0700 schrieb Martin Jambon:
> Hello,
> 
> Is there a way to write portable OCaml code which creates a directory
> with the default permissions as defined by umask?

I don't see your problem. Unix.mkdir filename 0o777 does exactly what
you want.

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Creating a directory with default permissions
  2006-10-20 19:21 ` [Caml-list] " Gerd Stolpmann
@ 2006-10-20 21:41   ` Martin Jambon
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Jambon @ 2006-10-20 21:41 UTC (permalink / raw)
  To: Gerd Stolpmann; +Cc: caml-list

On Fri, 20 Oct 2006, Gerd Stolpmann wrote:

> Am Freitag, den 20.10.2006, 11:43 -0700 schrieb Martin Jambon:
> > Hello,
> >
> > Is there a way to write portable OCaml code which creates a directory
> > with the default permissions as defined by umask?
>
> I don't see your problem. Unix.mkdir filename 0o777 does exactly what
> you want.

Oh yes, Thank you!

I got misled by the documentation which says:

val mkdir : string -> file_perm -> unit
       Create a directory with the given permissions.


Martin

--
Martin Jambon, PhD
http://martin.jambon.free.fr


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-10-20 21:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-20 18:43 Creating a directory with default permissions Martin Jambon
2006-10-20 19:21 ` [Caml-list] " Gerd Stolpmann
2006-10-20 21:41   ` Martin Jambon

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