This page is "http://www.cs.tut.fi/~albert/BOAR/dos.html".
Where not otherwise stated, functions return DOS_FALSE for failure, in which case more information about the reason for the failure can be obtained using the IoErr() call. PrintFault() can be used to display a human-readable error string.
One reason for a failed call may be that the handler in question does not implement or recognize the action. In these cases IoErr() should return ERROR_NOT_IMPLEMENTED or ERROR_ACTION_NOT_KNOWN.
MODE_NEWFILE will create a new file and delete the old version if any exists. MODE_READWRITE will open an existing file for writing. Open in this mode will fail if the file does not already exist or the file is already opened by anyone else.
Interactive handlers are allowed to return less data than requested. This does not mean that there is no more data to be read ! In raw mode Read() does not block if WaitForChar() returned DOS_TRUE.
If you try to seek out of the bounds of the file, DOS_FALSE (0) is returned. If the seek was successful, DOS_TRUE (non-0) is returned and the old position is returned as a secondary error, which can be read with IoErr().
The serial handler translates single newlines and carriage returns to CR+LF pairs, even in raw mode. To bypass this, use SetMode(handle, MODE_RAW | MODE_NOCRLF);.
After a successful WaitForChar() IoErr() can be used to find out about how many characters (at least) are waiting to be read. The next Read() will NOT block if there are any characters waiting and the stream is in raw mode.
Examine() should be always called with the lock before using ExNext() or the results may be uncorrect. If the original lock was for a file, ExNext() always fails.
Returns NULL if the lock is not suitable or for example the directory does not have execute permissions for the user. If successful, returns the lock to the old current directory. This lock should be UnLock():ed by the user.
Many kinds of parameters can be set if the default values do not fit the purpose:
NP_Seglist seglist of code to run NP_FreeSeglist free seglist on exit. Default is TRUE NP_Entry entry point (mutually exclusive with NP_SegList) NP_Input fh - default is Open("NIL:", MODE_OLDFILE); NP_Output fh - default is Open("NIL:", MODE_NEWFILE); NP_Error fh - default is Open("NIL:", MODE_NEWFILE); NP_CloseInput close input filehandle on exit - default is TRUE NP_CloseOutput close output filehandle on exit - default is TRUE NP_CloseError close error filehandle on exit- default is TRUE NP_CurrentDir lock - default is parent's dir NP_StackSize stacksize for process - default is 4000 NP_Name name for process - default is "New Process" NP_Priority priority - default same as parent NP_CopyVars to copy local vars - default is TRUE NP_Path path - default is copy of parent's path NP_Arguments argument string (char *) TAG_DONE ends the tagsExample:
CreateNewProcTags( NP_Seglist, segl, NP_Name, "MyChild", NP_CopyVars, FALSE, TAG_DONE );
If the call succeeds, the lock becomes the property of the dos.library and may not be freed or otherwise used by the program.
If the call succeeds, the lock becomes the property of the dos.library and may not be freed or otherwise used by the program.
Until buffering is added you should only use format commands
in the format string to get the best performace.
FPrintF(Output(), "%s%d\n", "Hello ", count);