uce/site/doc/pages/file_symlink.txt
2026-06-16 23:02:45 +00:00

22 lines
621 B
Plaintext

:sig
bool file_symlink(String target, String linkpath)
:params
target : path the symlink should point at
linkpath : symlink to create
return value : true on success
:content
Creates a symbolic link at `linkpath` pointing to `target`. Reading through the link reads the target; use `path_real()` to resolve a link to its canonical destination.
:example
file_put_contents("/tmp/doc-symlink-target.txt", "data");
file_unlink("/tmp/doc-symlink-link.txt");
file_symlink("/tmp/doc-symlink-target.txt", "/tmp/doc-symlink-link.txt");
print(file_get_contents("/tmp/doc-symlink-link.txt"), "\n");
:see
>sys
path_real
file_stat