comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: more Ada.Directories questions
Date: Fri, 1 Apr 2011 05:49:35 +0000 (UTC)
Date: 2011-04-01T05:49:35+00:00	[thread overview]
Message-ID: <in3p1f$3fa$1@speranza.aioe.org> (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?



             reply	other threads:[~2011-04-01  5:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-01  5:49 tmoran [this message]
2011-04-01 15:27 ` more Ada.Directories questions Adam Beneschan
2011-04-02  1:34   ` Randy Brukardt
replies disabled

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