_splitpath在Linux中 [英] _splitpath in Linux

查看:321
本文介绍了_splitpath在Linux中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Linux是否具有Win32 API _splitpath函数的等效版本?
详细信息:

Is there a Linux equivalent of the Win32 API _splitpath function?
Details:

void _splitpath (
   const char *path,  // Path Input
   char *drive,       // Drive     : Output
   char *dir,         // Directory : Output
   char *fname,       // Filename  : Output
   char *ext          // Extension : Output
);

它以完整路径作为输入,并提供驱动器,目录,文件名和扩展名作为输出.

It takes full path as input and gives drive, directory, filename and extension as output.

推荐答案

dirname() basename()

这篇关于_splitpath在Linux中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆