Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>symlink</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
symlink
=======

Syntax
------

     #include <unistd.h>
     
     int symlink(const char *exists, const char *new);

Description
-----------

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.)

Return Value
------------

Zero in case of success, -1 in case of failure (and `errno' set to the
appropriate error code).

Example
-------

     symlink ("c:/djgpp/bin/grep", "c:/djgpp/bin/fgrep");


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson