| www.delorie.com/djgpp/doc/libc-2.01/libc_633.html | search |
#include <unistd.h> int symlink(const char *exists, const char *new);
MSDOS doesn't support symbolic links. However, DJGPP supports
"symlinks" to DJGPP programs. This function simulates a symlink
between two `.exe' files in the DJGPP style. It creates a program
whose name is given by *new which, when run, will actually execute
the program *exists passing it *new in argv[0] (some
programs change their behavior depending on what's passed in
argv[0]). The file referred to by exists doesn't really
have to exist when this function is called. Both *new and
*exists can point to a name with or without the `.exe'
extension.
Note that both *exists and *new must reside in the same
directory (this is a restriction of the DJGPP "symlinks"); the
function will fail and set errno to EXDEV if they aren't.
Also note that this function does nothing to ensure that *exists
is actually a DJGPP program.
This functions runs the `stubify' and `stubedit' programs, so they should be somewhere on your `PATH' for the function to succeed. (These programs come with the DJGPP development distribution.)
Zero in case of success, -1 in case of failure (and errno set to
the appropriate error code).
symlink ("c:/djgpp/bin/grep", "c:/djgpp/bin/fgrep");
Go to the first, previous, next, last section, table of contents.
| prev next webmaster | delorie software privacy |
| Copyright © 1997 | Updated Apr 1997 |