Deno.readlink
readLink
-
readLink(path: string): Promise<string>
-
解析并返回符号链接对目标文件的绝对路径。
Resolves to the full path destination of the named symbolic link.
await Deno.symlink("./test.txt", "./test_link.txt"); const target = await Deno.readLink("./test_link.txt"); // ./test.txt 的绝对路径
如果使用硬链接调用,则会抛出
TypeError
。Throws TypeError if called with a hard link
需要
allow-read
权限。Requires
allow-read
permission.
参数
- ##### path: string