xproc / Vnext

Assembly point for all issues for a next version of XProc
1 stars 0 forks source link

Enhancement: open p:file-copy p:file-delete p:file-move to sequence of anyURIs #25

Open Arithmeticus opened 4 years ago

Arithmeticus commented 4 years ago

Enhancement suggestion: open p:file-copy, -delete, and -move to apply to multiple input items, either by changing option href to permit a sequence of anyURIs or by providing a new option to filter via glob-like syntax. I realize you can embed these commands in iterative constructions, but I think my suggestion could help create cleaner, more maintainable code.

xatapult commented 4 years ago

@Arithmeticus Thanks for the suggestion. I've transferred it to our special repo for gathering all ideas for a next version, https://github.com/xproc/Vnext.

3.0 is considered finished, so it will not be in this version. If we ever come around to discussing a new version it will be on the list!

xml-project commented 4 years ago

@Arithmeticus this issue is currently under investigation. Our first option would be to leave the steps as they are, but supply a library of step written in XProc which take a path option, an include-filter and an exclude-filter (both regex). This step would simply be a p:directory-list with the given values and then an iteration over all results performing the copy, delete or move action. However if that turns out to be to slow or to inconvinient to user, we will are open to add additional steps (e.g. p:file-group-copy, p:file-group-delete and file-group-move) with the requested functionality.

Arithmeticus commented 4 years ago

@xml-project I agree, and add that in many file operations, users would expect to access other parameters, such as specifying conditions under which files should be overwritten (date, file size). Also, I think most users expect to use globlike syntax, not regular expressions ('though I prefer the latter). I have hammered out some prototypes along the lines mentioned under the branch xproc-test of this repo: https://github.com/Arithmeticus/XML-Pantry/tree/xproc-test  

That includes a function ladder:glob-to-regex() that could be useful in other contexts.

xml-project commented 4 years ago

@Arithmeticus Yes, that makes sense to me. Thanks. Could you check your supplied link please. It gives me a 404.

Arithmeticus commented 4 years ago

Oops! https://github.com/Arithmeticus/XML-Pantry/tree/xproc-test

xatapult commented 4 years ago

Will be moved to vnext as of editors call 2020-10-22