Pascal / BaseUnix / FpLink
FpAccess, FpAlarm, FpChdir, FpChmod, FpChown, FpClose, FpClosedir, FpDup, FpDup2, FpExecv, FpExecve, FpExit, FpFcntl, pfdfillset, fpFD_CLR, fpFD_ISSET, fpFD_SET, fpFD_ZERO, FpFork, FPFStat, FpFtruncate, FpGetcwd, FpGetegid, FpGetEnv, fpgeterrno, FpGeteuid, FpGetgid, FpGetgroups, FpGetpgrp, FpGetpid, FpGetppid, fpGetPriority, FpGetuid, FpIOCtl, FpKill, » FpLink, FpLseek, fpLstat, FpMkdir, FpMkfifo, Fpmmap, Fpmunmap, FpNanoSleep, fpNice, FpOpen, FpOpendir, FpPause, FpPipe, FpRead, FpReaddir, fpReadLink, FpRename, FpRmdir, fpSelect, fpseterrno, FpSetgid, fpSetPriority, FpSetsid, fpsettimeofday, FpSetuid,
Funcion: FpLink()
Sintaxis:
function FpLink(
 
  existing: pChar;
 
  newone: pChar
 
):cInt;
 
function FpLink(
 
  existi

Descripcion: Convierte NewOne en un puntero a un archivo existing. Los dos archivos tienen entones el inode numero. Esto es conocido como un "hard" link. La funcion retorna zero si fue ejecutada correctamente y retorna un valor diferente de zero si ocurrio algun error.

ERRORES:
Los siguientes codigos de error pueden ser regrezados.

sys_exdev
Existing and NewOne are not on the same filesystem.
sys_eperm
The filesystem containing Existing and NewOne doesn't support linking files.
sys_eaccess
Write access for the directory containing NewOne is disallowed, or one of the directories in Existing or NewOne has no search (=execute) permission.
sys_enoent
A directory entry in Existing or NewOne does not exist or is a symbolic link pointing to a non-existent directory.
sys_enotdir
A directory entry in Existing or NewOne is nor a directory.
sys_enomem
Insufficient kernel memory.
sys_erofs
The files are on a read-only filesystem.
sys_eexist
NewOne already exists.
sys_emlink
Existing has reached maximal link count.
sys_eloop
existing or NewOne has a reference to a circular symbolic link, i.e. a symbolic link, whose expansion points to itself.
sys_enospc
The device containing NewOne has no room for another entry.
sys_eperm
Existing points to . or .. of a directory.

Vea tambien
fpSymLink, fpUnLink

Ejemplo:
Program Example21;
 
{ Program to demonstrate the Link and UnLink functions. }
 
Uses BaseUnix;
 
Var F : Text;
    S : String;
begin
  Assign (F,'test.txt');
  Rewrite (F);
  Writeln (F,'This is written to test.txt');
  Close(f);
  { new.txt and test.txt are now the same file }
  if fpLink ('test.txt','new.txt')<>0 then
    writeln ('Error when linking !');
  { Removing test.txt still leaves new.txt }
  If fpUnlink ('test.txt')<>0 then
    Writeln ('Error when unlinking !');
  Assign (f,'new.txt');
  Reset (F);
  While not EOF(f) do
    begin
    Readln(F,S);
    Writeln ('> ',s);
    end;
 Close (f);
 { Remove new.txt also }
 If not FPUnlink ('new.txt')<>0 then
   Writeln ('Error when unlinking !');
end.

Librerias Pascal

Libreria crt - CRT - Pantalla y teclado del PASCAL de Turbo que maneja la unidad
Libreria dos - DOS - Interface Turbo Pascal MS-DOS
Libreria Graph - Unidad para manipular los graficos de la pantalla compatible con TP
Libreria Objects - Objetos basicos compatible con TP
Libreria math - Rutinas adicionales matematicas
Libreria Printer - Provee de acceso a la impresora
Libreria strings - Rutinas para el manejo de cadenas
Libreria BaseUnix - Funcionalidad Basica de Linux
Libreria System - Manejo de Archivos - Funciones para la manipulacion de archivos en Pascal