验证_tmkdir是否成功
任何人都可以帮我找出如何验证 _tmkdir
是否成功。 例如,我希望在另一个文件夹中创建一个文件。我将在运行时创建该文件夹。所以我将给出以下命令。
sFilePath = sFilePath + _T("\\P-Series Communication Logs");
_tmkdir( sFilePath );
其中 sFilePath 最初包含从注册表获取的软件安装路径。
我想知道 _tmkdir
是否成功。
谢谢
Can anybody help me in finding out how to verify that _tmkdir
succeeded.
For example i wish to create a file within another folder. This folder i will create at runtime. So i will give the following command.
sFilePath = sFilePath + _T("\\P-Series Communication Logs");
_tmkdir( sFilePath );
where sFilePath
would initially contain a software installation path which will be obtained from registry.
i wish to know if _tmkdir
succeeded or not.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过查看
_tmkdir
的返回值来判断调用是否成功。如果失败,errno
全局变量会指示失败的原因:有关详细信息,请参阅
_tmkdir
的 MSDN 文档 此处 和errno
此处。我希望这有帮助!
You can check the return value of
_tmkdir
to see if the call succeeded. If it failed, theerrno
global variable indicates the reason for failure:For more information, look at the MSDN documentation for
_tmkdir
here anderrno
here.I hope this helps!