请输入您要查询的百科知识:

 

词条 realpath
释义

相关函数: readlink, getcwd

表头文件: #include <limits.h>

#include <stdlib.h>

函数原型:char *realpath(const char *path, char *resolved_path)

函数说明:realpath()用来将参数path所指的相对路径转换成绝对路径后存于参数resolved_path所指的字符串数组或指针中

返回值: 成功则返回指向resolved_path的指针,失败返回NULL,错误代码存于errno

范例:

#include <unistd.h>

main()

{

char resolved_path[80];

realpath("/usr/X11R6/lib/modules/../../include/../",resolved_path);

printf("resolved_path: %s\", resolved_path);

}

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/3/20 22:42:08