获取相对于特定目录的文件路径 [英] Getting a file path relative to a particular directory

查看:37
本文介绍了获取相对于特定目录的文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

WinAPI 中是否有一种获取相对于另一路径的路径的好方法?例如:

Is there a nice way in the WinAPI to get a path relative to another path? For example:

有一个相对于以下的路径列表:

Have a list of paths relative to:

a\b\c\d

我想将它们全部更改为相对于

And I'd like to change them all to paths relative to

a\b\c

有没有一种巧妙的方法可以做到这一点,还是应该进行路径解析?

Is there a neat way to do this or should I get path parsing?

推荐答案

据我所知,windows API 中没有这样的功能,但是有例如提供该功能的 CodeGuru 文章.

As far as i know there is no such functionality in the windows API, but there is e.g. an article on CodeGuru that provides that functionality.

编辑:
我纠正了,有 PathRelativePathTo()这个答案中提到的shell api中.

这篇关于获取相对于特定目录的文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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