This document is supposed to be sort-of a checklist for DJGPP programmers especially when porting programs from either Unix or some other Dos compiler. You should be able to go through the list and say ``I thought of that'' or ``that doesn't apply to this program'' to every item. Sometimes you'll have to say ``OK, I'll document this.''
You might very well also want to take a look at the Frequently Asked Questions (FAQ).
"\r\n"if you like). Unix files are terminated by only
DJGPP will supply automatic conversion in such a way that the program
will see Unix-style files when the files are opened as text
files. This is specified using
O_TEXT for (e.g.)
open or a
t for (e.g.)
For binary files the corresponding names are
If unspecified, the value of
_fmode is used. This
O_TEXT per default.
You will want to think about the mode for every file you open. If
you're porting a Unix program, setting
O_BINARY at the start of your program might be a good
idea. Read also the documentation for
__DJGPP__to mark code special to DJGPP; use
__MSDOS__to mark code special to Dos. (If you have to write code that works with DJGPP V1 also, consider using
__GO32__which was defined also in V1.)
/dev/) supplied with a device name is ignored. Anything from and including the first dot in the final path component is also ignored. The null device is called
NUL. See also file names.
command.com) changes all references to environment variables to upper case. The environment as such has case sensitivity, but the user has no simply way of using that. Also, there is no simple way to set a variable to the empty string.
Only one dot is allowed in every path component and it must not be the first character. Only the first eight characters before the dot and the first three after are significant. The only significance of the dot is to separate the two parts.
Since Dos uses drive letters, paths that start with a slash are not absolute.
Front slashes (
/) and backslashes (
are equivalent. DJGPP's C library will make sure you see front
argveffect for programs, see the FAQ on symlinks and the documentation for the
stubeditprogram if that exists.)
pipeworks by running the producer and the consumer sequentially.
$SHELL) note that the standard Dos shell (
/cwhere Unix' takes
-c. You should avoid using the shell if you can because
command.comimposes limits on the length of a command line and will zero the return code. Using
command.comonly for commands like
dirand batch files, and will handle redirection for you. See also the FAQ on command-lines and about current directory.
command.com, not Dos as such.)
/) and not backslashes (
\) from the library functions that give you file names except for parts you supplied yourself. You can use either yourself.
farptr.hheader file, which see. Key words like
hugecan probably be ignored or #defined away.
renamewill move files like the Unix
renamedoes. In particular, the target will be deleted if it exists and you can move directories (``prune-and-graft'').
intis 32 bits. If you need a 16 bit int, use
short. (For readability and portability you might be far better off defining
remove) will delete files like the Unix
unlink. This means that the read-only flag on the file is ignored.
|webmaster||delorie software privacy|
|Copyright © 1998 by||Updated Nov 1998|