简体   繁体   English

是否有stat()的宽字符版本(来自sys / stat.h)?

[英]Is there a wide character version of stat() (from sys/stat.h)?

I have been using stat() for checking the existence of a file, which I understand is better practice than trying to open a file. 我一直在使用stat()检查文件是否存在,据我了解,这比尝试打开文件更好。 However, stat() doesn't work for filenames containing unicode characters in other languages. 但是,stat()不适用于包含其他语言中的unicode字符的文件名。 Is there a wide character version of stat(), or something equivalent that I can use? 是否有stat()的宽字符版本,或者我可以使用的等效版本?

If not, what is the next acceptable solution for checking existence of a file? 如果没有,那么检查文件存在的下一个可接受的解决方案是什么?

在Windows中,您可以使用宽字符版本: _wstat

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM