Unit 'amigados' Package
[Overview][Constants][Types][Procedures and functions][Index] [#amunits]

ReadLink

Reads the path for a soft filesystem link

Declaration

Source position: amigados.pas line 1696

function ReadLink(

  port: pMsgPort;

  lock: LongInt;

  const path: pCHAR;

  buffer: pCHAR;

  size: LongWord

):LongBool;

function ReadLink(

  port: pMsgPort;

  lock: LongInt;

  const path: string;

  buffer: pCHAR;

  size: LongWord

):Boolean;

Arguments

port

  

MsgPort of the filesystem

lock

  

Lock this path is relative to on the filesystem

buffer

  

Pointer to buffer for new path from handler.

size

  

Size of buffer.

Function result

>= 0
Length of resolved filename in case of success
= -1
Failure, see IoErr() for more information
= -2
Buffer size was too small to store resolved filename

Arguments

port

  

MsgPort of the filesystem

lock

  

Lock this path is relative to on the filesystem

buffer

  

Pointer to buffer for new path from handler.

size

  

Size of buffer.

Description

ReadLink() takes a lock/name pair (usually from a failed attempt to use them to access an object with packets), and asks the filesystem to find the softlink and fill buffer with the modified path string. You then start the resolution process again by calling GetDeviceProc() with the new string from ReadLink().

Soft-links are resolved at access time by a combination of the filesystem (by returning ERROR_IS_SOFT_LINK to dos), and by Dos (using ReadLink() to resolve any links that are hit).

See also

MakeLink

  

Creates a filesystem link

DosOpen

  

Open a file for input or output

Lock

  

Lock a directory or file

GetDeviceProc

  

Finds a handler to send a message to


Documentation generated on: 2021-07-30