开发者

What does it mean "regular file" according to S_ISREG C/C++?

Let's consider the following 3 code lines:

struct stat buffer;       
status = lstat(file.c_str(), &buf开发者_高级运维fer);  
bool Flag = S_ISREG(buffer.st_mode)

When S_ISREG() returns true it tells you that the file is a regular file

What does regular means exactly ?

Thanks


It is non-standard, you should check the documentation for your CRT implementation. But it ought to mean that the name refers to a regular file, instead of a pipe, stream, symbolic link, directory or device.


Regular means it's not a directory, not a symlink, not a block device, and not a character device. It's just... regular. :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜