glob

cmake glob include while preserving directory structure

ぐ巨炮叔叔 提交于 2019-12-03 10:41:33
I'm new to cmake and I'm trying to install .hpp files while preserving directory structure. So far I have FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp" "${CMAKE_CURRENT_SOURCE_DIR}/include/MyLib/*.hpp" "${CMAKE_CURRENT_SOURCE_DIR}/include/MyLib/detail/*.hpp" install (FILES ${files} DESTINATION include) All the files get found but the directory hierarchy is flattened. FWIW The bjam command I'm trying to emulate is install headers : ../include/EnsembleLearning.hpp [ glob ../include/MyLib/*.hpp ] [ glob ../include/MyLib/detail/*.hpp ] : <install-source-root>../include ; You can use

How to list an image sequence in an efficient way? Numercial sequence comparison in Python

和自甴很熟 提交于 2019-12-03 10:10:31
问题 I have a directory of 9 images: image_0001, image_0002, image_0003 image_0010, image_0011 image_0011-1, image_0011-2, image_0011-3 image_9999 I would like to be able to list them in an efficient way, like this (4 entries for 9 images): (image_000[1-3], image_00[10-11], image_0011-[1-3], image_9999) Is there a way in python, to return a directory of images, in a short/clear way (without listing every file)? So, possibly something like this: list all images, sort numerically, create a list

php “glob” and data-deduplication?

﹥>﹥吖頭↗ 提交于 2019-12-03 10:02:04
I have a php-application which is (per request) scanning for the existance of some files. (on a network share) I'm using glob for this, cause usually i just know the beginning of the filename. I noticed, that glob does not return files, that are currently opened by any client, thus my application thinks file_xy is not existing, if somebody has opened it. Is there a way to make glob return opened (:= locked?) files as well? The strange thing is, that this is no where mentioned. However I can confirm that glob is NOT returning files, that are currently opened by a client... (As soon as the

How to use cmake's target_link_libraries to link libraries matching a glob?

ⅰ亾dé卋堺 提交于 2019-12-03 08:56:07
I have prebuilt thirdparty libraries (Boost) which I want to link to my target. All of them is stored under one directory like ${BOOST_PATH}/lib/libboost_thread.a, ${BOOST_PATH}/lib/libboost_log.a, etc. So I would like to do something like this: target_link_libraries(${TARGET} PRIVATE "${BOOST_PATH}/libboost*.a") I've read that FILE(GLOB...) might be used but strongly discouraged. And I am not sure that it would work at all. Why? How would you solve this problem if you cannot change the directory structure of the Boost libraries? There are two possibilities. Using glob is discouraged because

Glob wildcards in windows npm

℡╲_俬逩灬. 提交于 2019-12-03 07:16:21
I'm trying to get npm to do a build browserify on a folder of scripts. The problem is, I'm on windows and doing folder/*.js doesn't seem to work. I've tried globally installing glob, but whenever I run a build command, the error comes back saying "Cannot find module 'c:\www\project\static\js\components*.js'. Here's my package.json: { "name": "TEST", "description": "ITS ME MARIO", "author": "JJ", "version": "0.0.1", "dependencies": { "connect": "1.8.5", "express": "2.5.2", "jade": "0.20.0", "mongoose": "3.8.x", "socket.io": "0.8.7" }, "devDependencies": { "vows": "0.5.x", "mocha": "*", "should"

Glob /* doesn't match files starting with dot

喜夏-厌秋 提交于 2019-12-03 05:53:16
I'm using gulp to copy all files from one dir to another using code like this: gulp.src([ 'app/**/*' ]).pipe(gulp.dest('dist')); Glob docs say * match all files, but in fact files which have names starting with dot, like .gitignore , are not copied. How can it be worked around? Tony Barnes If you add the option dot: true , it should work. Eg: gulp.task('something', function () { return gulp.src([ 'app/**/*' ], { dot: true }).pipe(gulp.dest('dist')); }); Reference 来源: https://stackoverflow.com/questions/29533843/glob-doesnt-match-files-starting-with-dot

node.js glob pattern for excluding multiple files

旧城冷巷雨未停 提交于 2019-12-03 04:44:02
问题 I'm using the npm module node-glob. This snippet returns recursively all files in the current working directory. var glob = require('glob'); glob('**/*', function(err, files) { console.log(files); }); sample output: [ 'index.html', 'js', 'js/app.js', 'js/lib.js' ] I want to exclude index.html and js/lib.js . I tried to exclude these files with negative pattern '!' but without luck. Is there a way to achieve this only by using a pattern? 回答1: Or without an external dependency: /** Walk

Python glob but against a list of strings rather than the filesystem

a 夏天 提交于 2019-12-03 04:12:58
I want to be able to match a pattern in glob format to a list of strings, rather than to actual files in the filesystem. Is there any way to do this, or convert a glob pattern easily to a regex? Good artists copy; great artists steal . I stole ;) fnmatch.translate translates globs ? and * to regex . and .* respectively. I tweaked it not to. import re def glob2re(pat): """Translate a shell PATTERN to a regular expression. There is no way to quote meta-characters. """ i, n = 0, len(pat) res = '' while i < n: c = pat[i] i = i+1 if c == '*': #res = res + '.*' res = res + '[^/]*' elif c == '?':

git: How do I recursively add all files in a directory subtree that match a glob pattern?

南笙酒味 提交于 2019-12-03 04:04:10
问题 I have several .screen files inside /xxx/documentation and its subdirectories that are already tracked by Git. After modifying many of these screen files, I run git add documentation/\\*.screen —as indicated by the first example in git-add 's documentation—to stage these files, but the command fails: fatal: pathspec 'documentation/\*.screen' did not match any files Is my command bad, or does git have a bug? 回答1: It's a bug in the documentation. Quote the asterisk with $ git add documentation/

Node glob pattern for every .js file except .spec.js

本秂侑毒 提交于 2019-12-03 03:25:56
问题 I am looking for a better glob pattern for usemin, i want to to find all .js files but exclude the .spec.js files. I have the following solution so far. <script src="components/**/*(.js|!(*.spec.js|*.scss))"></script> The solution i have at the moment requires me to keep adding file extensions to exclude them, else they get picked up, for example .html files. I tried to make it only look for .js files and exclude the .spec.js from them but it does not seem to work. Also adding a !components/*