开发者

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

开发者 https://www.devze.com 2022-12-27 15:18 出处:网络
Let\'s consider the following 3 code lines: struct stat buffer; status = lstat(file.c_str(), &buf开发者_高级运维fer);

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

精彩评论

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