Specifications

SERIES 3/3A PROGRAMMING GUIDE
2-12
Creating directories when required
In contrast to file selectors on other systems, those on the Series 3 allow users to specify paths that do not
yet exist. This can happen fairly commonly, for example as follows:
The user inserts a brand new solid state disk into drive A
A
Save as
or
New file
menu command is invoked
The user adjusts the disc selector to this new disk
The user types eg "Backup" into the filename editor.
Then assuming the default directory for the application is
\DIR\
and the default extension is
.EXT
, the
filename returned to the application is
LOC::A:\DIR\BACKUP.EXT
even though the directory
\DIR\
does not exist yet, on the specified disk.
It is the responsibility of application programs to test for this case and to create the required directories.
Messages from the System Screen
Shutdown messages
Series 3 applications can receive
Shutdown
messages from the System Screen, as an instruction to shut
themselves down tidily, saving any changes to file as required.
These messages can arise when the user presses
DELETE
while highlighting a running task in the System
Screen. However, as mentioned above, if the application has set its
DatLocked
to
TRUE
, the System Screen
instead presents an
Application is busy
message.
Incidentally, applications are sent
Shutdown
messages only if they have a non-zero value of
DatProcessNamePtr
. The System Screen assumes that any application that has left this Epoc reserved
static at its default (zero) value is unlikely to be prepared to respond to
Shutdown
messages. In that case,
the System Screen instead calls
p_pterminate
to terminate the application.
Finally, note that any application which has
4000
included in its application type number will
never
be
sent a
Shutdown
message from the System Screen; instead, the System Screen will display the message
Cannot quit application
. Note that this blocking mechanism was designed for internal use only, and
should not be used without good reason.
Switchfiles messages
Series 3 applications can receive
Switchfiles
messages from the System Screen, as an instruction to close
down their existing open file, and to open or create another one.
These messages can arise when the user presses
ENTER
while highlighting a file within that application's
file list in the System Screen. However, if the application has set its
DatLocked
to
TRUE
, the System
Screen instead presents an
Application is busy
message.
Switchfile
messages will only ever be sent to applications with basic type number
2
or
3
. Applications
whose type numbers include
8000
can receive
Switchfile
messages of the Open sort, but not of the Create
sort.
How messages from the System Screen are received
There are two parts to an applications receiving a
Shutdown
or
Switchfiles
message from the System
Screen:
the application receives notification that
some
message from the System Screen has been sent
the application calls
wGetCommand
to determine the contents of the message.
In turn, the initial notification can be received in either of two ways, depending on whether the
application is receiving events from the Window Server directly (by calling
wGetEvent
or a variant), or as
"extended keypresses" via the console device (as occurs for example in Hwif programs):
for the protocol in the first case, see the discussion on
WM_COMMAND
in the
Window Server
Reference
manual
for the protocol in the second case, see the discussion on
P_EVENT_READ
in the
Console
chapter of
the
I/O Devices Reference
manual.