Checking if subfolders exist linux

Posted by laura on Stack Overflow See other posts from Stack Overflow or by laura
Published on 2010-04-05T17:45:29Z Indexed on 2010/04/05 18:03 UTC
Read the original article Hit count: 380

Filed under:
|
|

I'm trying to check if a folder has any subfolders without iterating through its children, in Linux. The closest I've found so far is using ftw and stopping at the first subfolder - or using scandir and filtering through the results. Both, are, however, an overkill for my purposes, I simply want a yes/no.

On Windows, this is done by calling SHGetFileInfo and then testing dwAttributes & SFGAO_HASSUBFOLDER on the returned structure. Is there such an option on Linux?

© Stack Overflow or respective owner

Related posts about c++

Related posts about linux