GLOB for directories

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

GLOB for directories

Boost - Build mailing list
I assume GLOB returns all files, including directories. How can I then
test for a directory as opposed to a non-directory file in a GLOB result
? I need to GLOB from a directory but only find those files that are
themselves directories. I could not find a rule which does this in some
module and I am hoping I just missed the module in which such
functionality exists.

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: GLOB for directories

Boost - Build mailing list
On Fri, 6 Mar 2020 at 10:31, Edward Diener via Boost-build
<[hidden email]> wrote:
>
> How can I then test for a directory as opposed to a non-directory file in a GLOB result?

You could try to negate CHECK_IF_FILE, a built-in which checks if file
is a file.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: GLOB for directories

Boost - Build mailing list
On 3/6/2020 4:53 AM, Mateusz Loskot via Boost-build wrote:
> On Fri, 6 Mar 2020 at 10:31, Edward Diener via Boost-build
> <[hidden email]> wrote:
>>
>> How can I then test for a directory as opposed to a non-directory file in a GLOB result?
>
> You could try to negate CHECK_IF_FILE, a built-in which checks if file
> is a file.

Thanks !

An undocumented built-in ?

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: GLOB for directories

Boost - Build mailing list
On Fri, 6 Mar 2020 at 17:13, Edward Diener via Boost-build
<[hidden email]> wrote:

> On 3/6/2020 4:53 AM, Mateusz Loskot via Boost-build wrote:
> > On Fri, 6 Mar 2020 at 10:31, Edward Diener via Boost-build <[hidden email]> wrote:
> >>
> >> How can I then test for a directory as opposed to a non-directory file in a GLOB result?
> >
> > You could try to negate CHECK_IF_FILE, a built-in which checks if file
> > is a file.
>
> Thanks !
>
> An undocumented built-in ?

Yes, I think it is not displayed in the docs.

I learned about it while learning how to glob for .hpp files
to generate some targets, and reading the .jam sources
https://github.com/boostorg/build/blob/master/src/util/path.jam#L272

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build