Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? AmigaOne
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

MAKELINK AmigaDOS
Purpose: Creates a link between files.
Format: MAKELINK [FROM] <file> [TO] <file> [SOFT] [FORCE]
Template: LINK=FROM/A, FILE=DIR=DIRECTORY=TO/A, SOFT/S, FORCE/S
Path: C:MAKELINK
MAKELINK creates a LINK file, also known as a FROM file, that is a pointer to another file, the TO file, on the disk. When an application or command attempts to access the LINK file, the TO file is used. There exist two types of links, hard links and soft links.

A hard link is some sort of "physical" link handled by the file system itself, it points to the physical location (e.g. a disk block) of the destination. This implies that both the link and the destination are on the same volume, that renaming the destination (including renaming into another directory) cannot "break" the link (it will continue to point to the same object) and that even deleting the destination won't cause problems (the link will be replaced with the file or directory before the file or directory is deleted). Not all file systems support hard links.

A soft link is some sort of "logical" link handled by the file system, dos.library and the applications, it points to a name which describes the path of the destination. All types of paths can be used (absolute and relative, with or without file name). This implies that both the link and the destination can be located on different volumes and that renaming or deleting the destination will "break" the link (it will point to a no longer existing object). Old applications are sometimes not aware of soft links and will consider them to be directories or ignore them altogether. Not all file systems support soft links. Old file systems may have problems with relative path names in soft links ("///dir2/file3"). Some applications may have problems with "broken" soft links for which the respective destinations do not exist any more.

By default, MAKELINK tries to create a hard link. When the SOFT option is given, MAKELINK tries to create a soft link. When the SOFT option is not given and the TO argument is a directory name, MAKELINK does normally not allow to create a hard link to a directory. When the FORCE option is also given, it allows it.

When creating a soft link, the link destination should exist, and MAKELINK will consider it an error if this is not the case. However, it is sometimes necessary to create a soft link before the link destination itself has been made available. In such a case, the FORCE option will cause MAKELINK to create the soft link regardless of whether the destination already exists or not. If MAKELINK detects that you are creating a circular link, such as a link to a parent directory, a 'Link loop not allowed' message is issued.

When you view Link files from the Shell, they are shown with <sl> beside them. When you view Link files from the Workbench, the filenames will be underlined.

Example 1:

3.OS4:> MAKELINK MyFile Real-File
3.OS4:> DIR
     Another-Dir (dir)
     Real-Dir (dir)
  MyFile   <sl> Real-File
creates a link called MyFile to RealFile in the current directory.

Example 2:

3.OS4:> MAKELINK MyFolder Real-Dir FORCE
3.OS4:> DIR
     Another-Dir (dir)
     MyFolder (dir) <sl>
     Real-Dir (dir)
  Real-File
creates a link called MyFolder to the Real-Dir directory.

Example 3:

3.OS4:> MAKELINK MyData Work:Examples/Statistics2006 SOFT
3.OS4:> DIR
     Another-Dir (dir)
     Real-Dir (dir)
  MyData   <sl> Real-File
creates a link called MyData to Statistics2006 in Examples directory on device Work:.


Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above Information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the Information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: February 9, 2006.