PHP Manual

  • English French German Portuguese Spanish
Manual de PHP Referencia de funciones Extensiones relacionadas con el sistema de ficheros Sistema de Ficheros Funciones del Sistema de Archivos link
Funciones del Sistema de Archivos basename chgrp chmod chown clearstatcache copy delete dirname disk_free_space disk_total_space diskfreespace fclose feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents file fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype flock fnmatch fopen fpassthru fputcsv fputs fread fscanf fseek fstat ftell ftruncate fwrite glob is_dir is_executable is_file is_link is_readable is_uploaded_file is_writable is_writeable lchgrp lchown link linkinfo lstat mkdir move_uploaded_file parse_ini_file parse_ini_string pathinfo pclose popen readfile readlink realpath_cache_get realpath_cache_size realpath rename rewind rmdir set_file_buffer stat symlink tempnam tmpfile touch umask unlink
  • lchown
  • linkinfo

link

(PHP 4, PHP 5)

link — Crea un enlace duro

Descripción

bool link ( string $target , string $link )

link() crea un enlace duro.

Parámetros

target

El objetivo del enlace.

link

El nombre del enlace.

Valores devueltos

Devuelve TRUE en caso de éxito o FALSE en caso de error.

Historial de cambios

Versión Descripción
5.3.0 Esta función ahora está disponible en plataformas Windows (Vista, Server 2008 o superiores).

Ejemplos

Ejemplo #1 Crear un simple enlace duro

<?php
$objetivo 
= 'origen.ext';  // Este es el archivo que ya existe
$enlace = 'nuevo_fichero.ext'; // Este es el nombre de fichero que quiere enlazar

link($objetivo, $enlace);
?>

Notas

Nota: Esta función no funcionará en ficheros remotos ya que el fichero debe ser accesible vía el sistema de ficheros del servidor para poder ser examinado.

Nota: Sólo para Windows: Esta función requiere que PHP se ejecute en un modo elevado o con el UAC deshabilitado.

Ver también

  • symlink() - Crea un enlace simbólico
  • readlink() - Devuelve el objetivo de un enlace simbólico
  • linkinfo() - Obtiene información acerca de un enlace

© Copyright © 2001-2015 The PHP Group.

© Copyright 2014. Diseñado por PHP Manual usando jfCMS.