Closed timotheecour closed 6 years ago
@citycide can we reopen? still doesn't work properly: in example above, do: cd ..
ls */*/z1.txt
d03/a1/z1.txt d04/a1/z1.txt
import glob,sequtils
echo toSeq(walkGlob("*/*/z1.txt"))
@[]
@citycide friendly ping :) this bug really limits usability of this otherwise excellent tool ...
Yeah I'm working on it but it hasn't been as simple as I thought it would be. Still in progress.
@citycide can you adapt https://github.com/git/git/blob/master/wildmatch.c to Nim (either via importc or via manual conversion, maybe starting gradually, starting from importc)? that seems like exactly what we want
top-level glob can use it as a building block; and we can implement BFS/DFS search on top of that. this is exactly what I did in my own (private... but I can revive and share it if needed) glob function for D
happy to discuss implementation details; but I think it could make sense to start from importc
to reuse code, incorporate it in higher level wrappers, and (in a later stage, if needed), gradually convert importc to nim
@timotheecour that doesn't support extended glob features like {}
groups and patterns. It's also not the problem area: matching works fine as-is, it's the file system traversal that is difficult because we need to partially match directories along the way.
doesn't support extended glob features like {} groups and patterns
Exactly! So I prefer filename_match from FLTK.
/cc @citycide this bug seems serious:
on linux:
find
pwd
/tmp/d03 /tmp/d03/A1 /tmp/d03/A1/z2.txt /tmp/d03/A1/Z2.txt /tmp/d03/a1 /tmp/d03/a1/z1.txt