comp.lang.ada
 help / color / mirror / Atom feed
* Atomic file creation
@ 2010-01-04 13:40 vlc
  2010-01-04 14:24 ` vlc
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: vlc @ 2010-01-04 13:40 UTC (permalink / raw)


Hi *,

I am looking for a way to create a file without overwriting it. A
simple approach would be:

1  if not Ada.Directories.Exists ("file") then
2     Ada.Text_IO.Create ("file");
3  end if;

But this is not completely safe as it is not atomic. A higher-priority
task e.g. could intercept my task between lines 1 and 2 and create the
same file. In this case the file would be overwritten.

Is there something like C's O_EXCL flag for "open" in Ada?

Thanks a lot in advance.



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

end of thread, other threads:[~2010-01-09 15:23 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-04 13:40 Atomic file creation vlc
2010-01-04 14:24 ` vlc
2010-01-04 15:52   ` Jean-Pierre Rosen
2010-01-04 16:45     ` vlc
2010-01-04 17:12       ` Jean-Pierre Rosen
2010-01-04 22:38         ` Ludovic Brenta
2010-01-04 23:00           ` Dmitry A. Kazakov
2010-01-05  9:15     ` Jacob Sparre Andersen
2010-01-05  4:16   ` Stephen Leake
2010-01-05 14:48     ` vlc
2010-01-09 15:23       ` Stephen Leake
2010-01-04 14:25 ` Georg Bauhaus
2010-01-04 14:45   ` vlc
2010-01-04 14:49 ` Jacob Sparre Andersen
2010-01-04 15:07   ` vlc
2010-01-04 17:14     ` Jacob Sparre Andersen
2010-01-05 14:43       ` vlc
2010-01-06  2:28     ` Brad Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox