Text Extractor TXR - Tasks: task #11434, Deprecate hacky pipe ! and...
You are not allowed to post comments on this tracker with your current authentication level.
task #11434: Deprecate hacky pipe ! and directory $ syntax; provide richer functionality.
Submitter: | Kaz Kylheku <kkylheku> | ||
Submitted: | Thu 13 Oct 2011 12:46:00 AM UTC | ||
Should Start On: | Wed 12 Oct 2011 07:00:00 AM UTC | Should be Finished on: | Wed 12 Oct 2011 07:00:00 AM UTC |
Category: | None | Priority: | 5 - Normal |
Status: | None | Privacy: | Public |
Assigned to: | None | Percent Complete: | 0% |
Open/Closed: | Open | Effort: | 0.00 |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
Carbon-Copy List
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
No changes have been made to this item
Powered by Savane 3.13-f8d8.
Corresponding source code
TXR uses a hack in its @(next) and @(output) directives. If a filename is prefixed with a ! it is a command process pipe to be opened for reading or writing. If it begins with $, it is a directory to be opened such that the directory entries are read as if they were lines of a text file.
Since we have keyword arguments, this hack is unnecessary and should be deprecated.
Secondly, there should be a way to specify to append to a file, rather than to overwrite it.
Furthermore, the directory reading functionality should be richer. It should allow the directory entries to be sorted, so the query doesn't have to resort to piping the output of "ls".
Furthermore, the directory stream can provide more information in the form of fields which the TXR query can capture with pattern matching. Instead of just the name of every directory entry, we can stat() the entry and provide arbitrary inode information: object type, permissions, timestamp, et cetera.
Perhaps a special syntax can specify exactly what fields to be made available and in what form. For instance
@(next :directory "." :format `@type:@uid:@name`)
Where the directory stream would then look like
dir:503:txr
file:503:.bashrc
That's just one idea.