2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
5 Desc: Create a hard or soft link.
8 #include <dos/dosextens.h>
9 #include "dos_intern.h"
10 #include <proto/exec.h>
12 /*****************************************************************************
15 #include <exec/types.h>
16 #include <proto/dos.h>
18 AROS_LH3(LONG
, MakeLink
,
21 AROS_LHA(CONST_STRPTR
, name
, D1
),
22 AROS_LHA(SIPTR
, dest
, D2
),
23 AROS_LHA(LONG
, soft
, D3
),
26 struct DosLibrary
*, DOSBase
, 74, Dos
)
29 MakeLink() will create a link between two files or directories.
30 A link is a filesystem object that refers to another file.
32 A soft link refers to another file or directory by name, and is
33 resolved by the filesystem and the caller. Soft links are not
34 restricted to the same volume and the target does not have to exist.
36 A hard link refers to another file by the location on a disk, and
37 is resolved by the filesystem. Hard links are restricted to files
38 or directories on the same volume.
41 name - The name of the link to create
42 dest - If 'soft' is TRUE this must be a filename; if it is FALSE a lock
43 pointing to the file to be hard-linked must be provided
44 soft - TRUE, if a soft link is to be created, FALSE for a hard link
47 boolean - DOSTRUE or DOSFALSE. On error, IoErr() will contain more
61 *****************************************************************************/
65 struct PacketHelperStruct phs
;
69 if (getpacketinfo(DOSBase
, name
, &phs
))
71 status
= dopacket4(DOSBase
, NULL
, phs
.port
, ACTION_MAKE_LINK
,
72 phs
.lock
, phs
.name
, (SIPTR
)dest
, soft
? LINK_SOFT
: LINK_HARD
);
73 freepacketinfo(DOSBase
, &phs
);