vtjnash / Glob.jl

Posix-compliant file name pattern matching
Other
126 stars 18 forks source link

Fully implement `GlobMatch`es starting with `/` #2

Open kmsquire opened 10 years ago

kmsquire commented 10 years ago

1 implements this for strings only, by stripping off the leading / before creating the GlobMatch object. Ideally, support would be in the GlobMatch object directly.

Alexander-Barth commented 5 years ago

I think that this would be great if Glob.jl would support absolute path. Or is there any reason for not supporting this?

vtjnash commented 5 years ago

Not really—I just didn't have an idea at the time for representing them (and, for a variety of reasons, didn't consider it as an expected use case initially). It's also a case where Windows is more than a bit wonky, making this less innocent that it might at first appear. (long story short, currently a "glob" is explicitly not a file path, but is more nearly a URI wildcard pattern fragment which returns a set of file paths when acted upon.)

diegozea commented 3 years ago

Hi!

First, thanks for this useful package :)

I think this is related to this issue. I think that the error message Glob pattern cannot be empty or start with a / character for glob could suggest trying using "/" as the second argument instead (and deleting it from the first):

glob("/home/diego")
glob("home/diego", "/")

image

A docstring for the function could be useful in the meantime.

Best,