I/O Errors - Maple Programming Help

I/O Errors

Description

 • The Maple I/O library will generate trappable errors whenever something goes wrong during a file I/O operation. This help page lists all the errors that can be generated.
 • This list is not exhaustive. It lists all the errors specific to the I/O library, but it does not list more general errors that can also occur when doing I/O (for example, a syntax error in the Maple input being parsed by scanf(%a)).
 • "TEXT mode not supported for raw I/O" - The open function can only open files as BINARY files. TEXT files must be opened using fopen.
 • "terminal or default can only be used with fopen" - The terminal and default output streams can only be opened using fopen.
 • "arguments must be strings or small integers" - Command-line arguments passed to a command to exec must be strings (which are passed as-is), or small integers (which are converted to strings).
 • "byte value is out of range" - A value in the list data passed to writebytes is outside the valid range of bytes (0 .. 255).
 • "command string and optional arguments expected" - The exec function requires the name of the executable to invoke, and optional command-line arguments for it.
 • "could not seek to initial offset - file closed" - A file currently open in READ mode has been automatically reopened in WRITE mode when a write operation was attempted (writeline, writebytes, or fprintf), but the file position could not be set back to the current position. As a result, the file has been closed (to prevent writing to the wrong place).
 • "descriptor does not specify a pipe" - A file descriptor passed to block does not specify a pipe, as returned by the pipe function.
 • "file I/O error" - An indeterminate error has occurred.  If the file was closed as a result, "file closed" will appear at the end of this message.
 • "file already open" - The specified file passed to fopen, open, or popen is already open.
 • "file and optional position expected" - The filepos function requires a file name or descriptor, and an optional position within the file.
 • "file currently in use by writeto or appendto" - An attempt was made to open a file, either explicitly or implicitly, while that file was already the target of an active writeto or appendto redirection.
 • "file descriptor not in use" - A file descriptor was passed to an I/O function, and that file descriptor does not refer to a currently open file.
 • "file mode must be READ or WRITE" - The file access mode passed to the fopen, open, or popen functions must be READ or WRITE (fopen also allows APPEND).
 • "file name and mode required" - The open function requires a file name and access mode (READ or WRITE).
 • "file name or descriptor required" - Most I/O functions require either a file name, or a file descriptor (as returned by fopen, open, popen, or pipe) as their first argument.
 • "file name refers to a directory" - The specified file name refers to a directory (or folder) rather than to an actual file.
 • "file name refers to an active executable" - The specified file name refers to an executable program which is currently running. This error will only occur on some systems, where it is not permitted to modify an executable that is running.
 • "file name too long" - The specified file name is too long. The maximum allowable length of a file name is operating system dependent.
 • "file name, mode, and optional type required" - The fopen (and popen) functions require a file (or command) name, file access mode (READ or WRITE), and an optional file type (TEXT or BINARY).
 • "file or directory does not exist" - The specified file could not be opened in READ mode because it does not exist.
 • "file position must be an integer or infinity" - The file position passed to filepos must be an integer (indicating the offset, in bytes, from the beginning of the file to which the file position should be set), or infinity, indicating that the file position should be set to the end of the file.
 • "file space quota exceeded" - While writing to a file, or closing a file that was open in WRITE mode, the user's disk space quota was exceeded.  If the file was closed as a result, "file closed" will appear at the end of this message.
 • "file type must be TEXT or BINARY" - The optional file type passed to fopen or popen must be TEXT or BINARY.
 • "format string expected" - The fprintf, sprintf, printf, fscanf, sscanf, and scanf functions expect a format string specifying the types of objects to be written or read.
 • "input and format strings expected" - The sscanf function expects a source string, and a format string specifying the types of objects to be written or read.
 • "insufficient parameters for * format" - A * width specification was used in the format string for fprintf, sprintf, or printf, and no parameter was passed to provide the width.
 • "insufficient parameters for .* format" - A * precision specification was used in the format string for fprintf, sprintf, or printf, and no parameter was passed to provide the precision.
 • "insufficient parameters for algebraic format" - A %a, %m, or %M format specification was used in the format string for fprintf, sprintf, or printf, and no corresponding parameter was passed.
 • "insufficient parameters for character format" - A %c format specification was used in the format string for fprintf, sprintf, or printf, and no corresponding parameter was passed.
 • "insufficient parameters for floating format" - A %e, %E, %f, %g, or %G format specification was used in the format string for fprintf, sprintf, or printf, and no corresponding parameter was passed.
 • "insufficient parameters for string format" - A %s "insufficient parameters for integer format" - A %d, %o, %x, or %X format specification was used in the format string for fprintf, sprintf, or printf, and no corresponding parameter was passed.
 • "insufficient parameters for string format" - A %s format specification was used in the format string for fprintf, sprintf, or printf, and no corresponding parameter was passed.
 • "integer expected for * in format" - A * width specification was used in the format string for fprintf, sprintf, or printf, and the corresponding parameter did not evaluate to an integer.
 • "integer expected for integer format" - A %d, %o, %x, or %X format specification was used in the format string for fprintf, sprintf, or printf, and the corresponding parameter did not evaluate to an integer.
 • "no space left on device" - While writing to a file, or closing a file that was open in WRITE mode, the disk became full.  If the file was closed as a result, "file closed" will appear at the end of this message.
 • "number expected for floating format" -  A %e, %E, %f, %g, or %G format specification was used in the format string for fprintf, sprintf, or printf, and the corresponding parameter did not evaluate to an integer, rational, or floating point value.
 • "operation failed, please try again" - An I/O operation failed due to a temporary resource shortage in the operating system. Attempting the operation again may result in success. This error message is extremely rare, and is not likely to be encountered.
 • "operation not allowed on default stream" - The specified operation (for example, fremove) is not valid on the default input or output stream.
 • "operation not allowed on terminal stream" - The specified operation (for example, fremove) is not valid on the terminal input or output stream.
 • "operation only supported for STREAM and RAW files" - The specified operation (for example, filepos) can only be performed on STREAM (implicitly opened or opened via fopen) and RAW (opened via open) files.
 • "operation only supported for STREAM files" - The specified operation (for example, feof) can only be performed on STREAM (implicitly opened or opened via fopen) files.
 • "optional byte count and/or TEXT expected" - The readbytes function expects an optional count of the number of bytes to read, and/or the optional TEXT specifier, and something other than either of these was passed instead.
 • "permission denied" - An attempt was made to read from a file on which the user does not have read permissions, or write to a file on which the user does not have write permissions.
 • "pipe descriptor required" - The pipe descriptor(s) passed to the block function must refer to open pipes (as opened by the pipe function).
 • "positive integer expected for .* in format" - A * precision specification was used in the format string for fprintf, sprintf, or printf, and the corresponding parameter did not evaluate to a positive integer.
 • "positive integer expected for process ID" - The process ID(s) passed to the kill function must be positive integers.
 • "read-only file system" - An attempt was made to write to a file on a read-only file system.
 • "string expected for string format" - A %s format specification was used in the format string for fprintf, sprintf, or printf, and the corresponding parameter did not evaluate to a string (a Maple name).
 • "string of length 1 expected for character format" - A %c format specification was used in the format string for fprintf, sprintf, or printf, and the corresponding string parameter did contain exactly one character.
 • "string or integer expected for character format" - A %c format specification was used in the format string for fprintf, sprintf, or printf, and the corresponding parameter did not evaluate to a string or small integer.
 • "string or list data expected" - The writebytes function expects either a string of characters or a list of small integers as its data (second) parameter.
 • "timeout and at least one pipe descriptor expected" - The block function expects a timeout interval (an integer, in seconds) and at least one file descriptor referring to an open pipe (as opened by the pipe function).
 • "too many files already open" - Too many files have been opened, and there are no file descriptors remaining for use. Close files that are no longer needed. The maximum allowable number of files that can be open is operating system dependent, and can be determined using the iostatus function.
 • "unexpected arguments" - A function which takes no arguments was passed arguments.
 • "unknown format code x" - The specified formatting code in the format string passed to fprintf, sprintf, printf, fscanf, sscanf, or scanf is not valid.