文件的父目录 [英] Parent directory of a file

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

问题描述

有没有办法找出使用C程序文件的父目录。我想给该目录中有文件相同的权限。这样才能做到这一点,我想知道该文件的父目录。任何帮助是AP preciated。

Is there any way to find out the parent directory of a file using C program. I would like to give same permissions for the file that the directory has. So as to do so, i would like to know the parent directory of the file. Any help is appreciated.

推荐答案

有在标准C.没有这种功能你可以试试你的运气在Windows上使用:
GetFullPathName http://msdn.microsoft.com/ EN-US /库/ aa364963%28V = vs.85%29.aspx

There is no such function in Standard C. You may try your luck on Windows with: GetFullPathName http://msdn.microsoft.com/en-us/library/aa364963%28v=vs.85%29.aspx

,然后也许_splitpath
http://msdn.microsoft.com/en -us /库/ e737s6tf%28V = VS.80%29.aspx

and then maybe _splitpath http://msdn.microsoft.com/en-us/library/e737s6tf%28v=vs.80%29.aspx

但作为写有没有做这类事情的标准功能。

But as written there's not Standard function for doing such kind of things.

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

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