2 Copyright © 1995-2008, 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(APTR
, 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
55 Soft links were not working in the ROM filesystem before version
62 This function calls either FSA_CREATE_HARDLINK or FSA_CREATE_SOFTLINK
63 on the filesystem of `name`.
65 *****************************************************************************/
69 struct PacketHelperStruct phs
;
73 if (getpacketinfo(DOSBase
, name
, &phs
)) {
74 status
= dopacket4(DOSBase
, NULL
, phs
.port
, ACTION_MAKE_LINK
, phs
.lock
, phs
.name
, (SIPTR
)name
, (IPTR
)soft
);
75 freepacketinfo(DOSBase
, &phs
);