glob

How do I ignore a file using gulp?

久未见 提交于 2019-12-13 04:51:25
问题 I have the following folder and file structure: Vendor bootstrap css -bootstrap.css js -bootstrap.js font-awesome css -font-awesome.css nivo-slider -nivo-slider.css theme -theme.css -theme-animate.css -theme-blog.css -theme-responsive.css -theme-shop.css I am trying to make sure that the css files are added to the stream in this specific order: 1) The bootstrap.css file src/vendor/bootstrap/css/bootstrap.css 2) All of the other css files inside the 'src/vendor/' sub-directories in no

PHP Glob: How to use multiple flags with glob function?

南楼画角 提交于 2019-12-13 04:39:23
问题 I want to use both GLOB_NOSORT and GLOB_BRACE with glob() function, is that possible? The reason is I don't want any sorting by glob() function, my current code looks like this: $filetypes = '{*.txt,*.pdf,*.doc,*.docx,*.zip,*.jpeg,*.jpg,*.gif,*.ping,*.zip,*.rar}'; //assign $files to results of glob() $files = glob($structure.$filetypes, GLOB_BRACE); usort($files, create_function('$a,$b', 'return filemtime($a) - filemtime($b);')); print_r($files); Above code will not sort the files according

Globbing and renaming accented files in Bash (continued)

有些话、适合烂在心里 提交于 2019-12-13 01:46:01
问题 This is a continuation of the following question: Globbing accented files in Bash I asked it there, but was encouraged to ask a new question. I have about 20,000 thousand files, many of which need to be renamed. If they have the same prefix, they are numbered sequentially regardless of extension. This isn't my problem, it just explains the options I'm using with the rename command below. Problem: Several filenames contain accented characters, which seem to prevent globs from being expanded.

Match path string using glob in Java

冷暖自知 提交于 2019-12-12 16:12:57
问题 I have following string as a glob rule: **/*.txt And test data: /foo/bar.txt /foo/buz.jpg /foo/oof/text.txt Is it possible to use glob rule (without converting glob to regex) to match test data and return valud entries ? One requirement: Java 1.6 回答1: If you have Java 7 can use FileSystem.getPathMatcher: final PathMatcher matcher = FileSystem.getPathMatcher("glob:**/*.txt"); This will require converting your strings into instances of Path : final Path myPath = Paths.get("/foo/bar.txt"); For

PHP glob directory UTF-8

纵饮孤独 提交于 2019-12-12 15:32:07
问题 I am trying to get all files within a variable path ... atm I am using glob(), but I just can not find a way to open a path which contains ä ü ö in it... I have tried a lot of de/encoding, but none seem to work... When I change the ä ü ö in the filename and the variable I get the right answer... so it has to be smth with utf8 chars...I guess PHP script // Get the variable via an Ajax post $town =$_POST['town']; // For example "Bankdrücken" $pfad = 'maps/'. $country.'/'. $town .'/*.jpg';

Glob pattern matching the first part of a file name

谁都会走 提交于 2019-12-12 13:36:25
问题 In a directory I have filenames like 123X1.jpg, 23X1.jpg, 23X2.jpg, 4123X1.jpg. I need the glob pattern to only get listed files starting with a required string. For example: '23X' -> 23X1.jpg, 23X2.jpg '123X' -> 123X1.jpg Last part part of the pattern is always an X. The first one is a number. 回答1: It's trivial with glob() : print_r(glob('/path/to/23X*.jpg')); print_r(glob('/path/to/123X*.jpg')); 回答2: You can try RegexIterator $fi = new FilesystemIterator(__DIR__, FilesystemIterator::SKIP

Globbing using braces on Ruby 1.9.3

随声附和 提交于 2019-12-12 08:33:16
问题 Recent versions of Ruby support the use of braces in globbing, if you use the File::FNM_EXTGLOB option From the 2.2.0 documentation File.fnmatch('c{at,ub}s', 'cats', File::FNM_EXTGLOB) #=> true # { } is supported on FNM_EXTGLOB However, the 1.9.3 documentation says it isn't supported in 1.9.3: File.fnmatch('c{at,ub}s', 'cats') #=> false # { } isn't supported (also, trying to use File::FNM_EXTGLOB gave a name error) Is there any way to glob using braces in Ruby 1.9.3, such as a third-party gem

Why can't python glob detect my thumbdrive (and what can I do about it?)

前提是你 提交于 2019-12-12 05:35:12
问题 So I got a thumb-drive plugged in. Its at /dev/sdb1 . Its got some files on it, and it is mounted. I do >>> glob.glob("/dev/sdb1/*") [] Why is this and what can I do about it? https://pypi.python.org/pypi/glob2 回答1: You are globbing on the device file . If you want to access the files, you need to glob on the mount point , which is (depending on your system) probably something like "/run/media/$USER/something", "/media/something" or "/mnt/something", where "something" might be sdb1 or the

Why does PathMatcher doesn't match path?

岁酱吖の 提交于 2019-12-12 04:08:58
问题 I research glob patterns. I wrote simple example: PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob:D:\\folder1\\folder2\\**"); boolean isMatches = matcher.matches(Paths.get("D:\\folder1\\folder2\\folder3")); System.out.println(isMatches); This code returns false . If I use one star in pattern - I see same result. What do I wrong? 回答1: Try with \\\\ in path expression, to escape directory and reg expression PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob

Function glob() not working with externe URL

半世苍凉 提交于 2019-12-11 23:25:55
问题 i'm confused with this problem when im working locally it's all fine with this : foreach (glob("public/FolderA/B/") as $filename) { but when i put foreach (glob("http://www.exemple.com/public/FolderA/B/") as $filename) { doesn't work any solution ??? History : in the past i'm working with glob() and communicate with local server and the scripte do this jobs perfect now donne is transfer t to other server and problem i get is how to put glob() working with external URL not locally or some