comp.lang.ada
 help / color / mirror / Atom feed
* more Ada.Directories questions
@ 2011-04-01  5:49 tmoran
  2011-04-01 15:27 ` Adam Beneschan
  0 siblings, 1 reply; 3+ messages in thread
From: tmoran @ 2011-04-01  5:49 UTC (permalink / raw)


Does Ada.Directories.Create_Directory("X"); raise Use_Error if directory X
already exists?  It seems it should if the system does not support
creation of something that already exists.  (On Windows at least, mkdir x
fails if x already exists.) Ditto if file "X" exists and the system won't
allow a file and a directory of the same name.  Does "Create" mean "change
the state of the file system" or does it mean "arrange that the file
system has a certain state"?  Create_Directory apparently means the
former.

Apparently the latter meaning applies to Create_Path, since
according to the Rationale, Ada.Directories.Create_Path("X");
does not raise Use_Error, but is a NOP, if directory X exists.

So the only reason to use Create_Directory rather than Create_Path is
to detect the case where a file or directory of that name already
exists, correct?

If "???" is an illegal name for a directory, it seems that
Create_Path("a/b/???/c"); will raise Name_Error without creating "a/b".
Correct?



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

end of thread, other threads:[~2011-04-02  1:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-01  5:49 more Ada.Directories questions tmoran
2011-04-01 15:27 ` Adam Beneschan
2011-04-02  1:34   ` Randy Brukardt

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