Detailed Descriptions > MIAMEX

MIAMEX 97: Make directory

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

(Windows only) This function provides a native Windows equivalent to MIAMEX Function 38 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.

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

This function will be invoked automatically if MIAMEX 38: Create is requested under Windows. Therefore, it is best to always use Function 38 in your application and let A-Shell decide when to convert it to MX_MKDIR.

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.

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.