Wie erstelle ich programmgesteuert einen Softlink in C/C++?

Lesezeit: 1 Minute

Benutzeravatar von Professor_Chaos
Professor_Chaos

Wie erstelle ich programmgesteuert einen Softlink in C/C++? Der Systemaufruf link() in Freebsd erstellt einen harten Link.

  • symlink Funktion definiert in unistd.h.

    – isedev

    30. September 2014 um 9:59 Uhr

Der gewünschte Systemaufruf ist Symlink(2).

#include <unistd.h>

int symlink(const char  *name1, const char *name2);

Ein symbolischer Link name2 erstellt wird name1

  • Danke, das hilft 🙂

    – Professor_Chaos

    30. September 2014 um 10:11 Uhr

Du kannst anrufen symlink()

int  symlink(const char *name1, const char *name2);

A symbolic  link name2 is created to name1 (name2 is the name of the file
created, name1 is the string used in creating the symbolic  link).  Either
name may be an arbitrary path name; the files need  not be on the same
file system.

  • Danke, das hilft. Neu in der Systemprogrammierung.

    – Professor_Chaos

    30. September 2014 um 10:13 Uhr

1443950cookie-checkWie erstelle ich programmgesteuert einen Softlink in C/C++?

This website is using cookies to improve the user-friendliness. You agree by using the website further.

Privacy policy