tags:

views:

37

answers:

1

The Phing User's Guide uses the following description of the ** file filter:

"Two asterisks (**) may include above the "border" of the directory separator."

I'm having a hard time deciphering what this really means. Can somebody please translate this into English?

+3  A: 

** matches any character while * matches anything except for a directory separator.

For example, /path/** will match either of these:

  • /path/file
  • /path/to/some/file
  • /path/to/some/other/file

However, /path/* will only match the first one.

Martin
Here's an example from the Phing User Guide:"**/*.ent.xml fits to all files that end with ent.xml in all subdirectories of the directory specified with the dir attribute of the <fileset> tag. However, it will not include any files that are directly in the base directory of the file set."This one was confounding me, but now I think I get it. The reason it doesn't match any files in the base directory has nothing to do with the nature of ** itself, but is because the filter starts with **/, which I take it to mean that the files must be in a subdirectory. Is that correct?
elmonty
Yes, the path `filename.ent.xml` (a file in the base directory) does not match the pattern `**/*.ent.xml` since it doesn't contain any `/` character.
Martin
Thank you. The description of ** from the user guide is really bad. Your description makes more sense.
elmonty