隐藏使用从C Windows API的文件或目录 [英] Hide a file or directory using the Windows API from C

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

问题描述

我想修改一个C程序做一些它在Windows创建的隐藏文件。哪些Windows或(甚至更好)POSIX API将设置隐藏属性?

I want to modify a C program to make some of the files it creates hidden in Windows. What Windows or (even better) POSIX API will set the hidden file attribute?

推荐答案

您可以通过调用SetFileAttributes并设置FILE_ATTRIBUTE_HIDDEN标志做到这一点。见<一href=\"http://msdn.microsoft.com/en-us/library/aa365535%28VS.85%29.aspx\">http://msdn.microsoft.com/en-us/library/aa365535%28VS.85%29.aspx

You can do it by calling SetFileAttributes and setting the FILE_ATTRIBUTE_HIDDEN flag. See http://msdn.microsoft.com/en-us/library/aa365535%28VS.85%29.aspx

这不,虽然POSIX。要建立在一般的POSIX系统如Linux一个隐藏的文件,只需启动一个文件名以点(。)。

This is not POSIX though. To create a 'hidden' file under a normal POSIX system like Linux, just start a filename with a dot (.).

这篇关于隐藏使用从C Windows API的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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