MIAMEX 97: Make directory

xcall MIAMEX, MX_MKDIR, dirspec, status {,remoteflag}

(Windows only) MX_MKDIR provides a native Windows equivalent to MX_MKPATH to create a directory.

Parameters

Parameter

Type

I/O

Description

dirspec

String

in

the directory name to create. This should be in native file format, but (as of build 960) may include embedded environment variables—e.g. %miame%\newdir.

status

Num

out

will return 0 for success, else a Windows system error number (183 for already-exists). -15 indicates ATE timeout. See MX_ERRNOMSG for translating system error codes to messages.

remoteflag

String, 1

in

may be optionally specified to clarify, in ATE environments, whether the directory is to be created on the server ("L" for local or "S" for server) or on the ATE client ("R" for remote or "C" for client). Specifying "L" on a UNIX machine is an error (returns status = -1) because this MIAMEX function only creates Windows directories.

 

Comments

MX_MKDIR will be invoked automatically if MX_MKPATH is requested under Windows. But your application still needs to be aware of whether it is running under Windows or UNIX because the directory naming syntax is typically different. Note that to create a directory on the ATE client, you must use MX_MKDIR, since MX_MKPATH does not have the remoteflag option.

There is no harm in attempting to create a directory that already exists; in fact, this may be easier than trying to first determine whether it exists. If the directory already existed, the return value will be 183, which should probably be handled as a non-error.

In general this function will not succeed if the parent directory doesn't already exist.

History

2011 July, A-Shell 5.1.1226:  The remoteflag parameter can now also accept "C" (for client) as an alias to "R" (remote) and "S" (server) as an alias to "L" (local). This is intended to reduce the chance of accidentally using the Client/Server notation in place of the Remote/Local notation. Experience has shown that some people are confused over which is the "Remote" and which is the "Local", which is why we've moved towards the Client/Server notation, which seems less confusing.