[QBS] Function to enumerate all files in desired directory

Joerg Bornemann joerg.bornemann at digia.com
Mon Jun 2 10:56:19 CEST 2014

On 30-May-14 14:01, Denis Shienkov wrote:

> 1)
> It is possible to create an some JS function to return a list of all
> available files (e.g. by a file mask or extension) in target directory?
> function(targetDirectory, fileMaskOrExtension) {
>      var fullFilePaths = [];
>      ...
>      ...
>      return fullFilePaths;
> }
> maybe similar core (example) is already exists in Qbs sources and so on?
> (but I can not find anything similar ...)

As of now there's no such function in JS context. The files properties 
of Product and Group support wildcards though.
Without extending the built-in JS extensions I don't see a good way to 
implement such a function... apart from an ugly hack by calling ls/dir 
and parsing the output.
Having such a function would be useful. Care to create a suggestion?



More information about the Qbs mailing list