ZTree.com  | ZEN  | About...  

 Index   Back

Very nice!   [Discuss]

By: Slobodan Vujnovic   Homepage   France  
Date: Jun 18,2002 at 22:58
In Response to: Possible solution (Juergen Hestermann)


Indeed, this looks like it handles everything, thanks to the fact that this design allows multiple actions on a single command line, similar to what we have in NT batch, for example, with command; command; command; etc. In other tools we have &, | etc., to chain commands.

Filespec also allows multiple file masks, so this won't be a radical novelty in ZTree's user input.

If we agree to change the word modifier to the more appropriate operator (or OP), and use the word modifier as meant originally, ie, to modify slightly the operator, can we accept this as the Rename "command line":

OP"oldstring1"newstring1"[modifier] (SPACE) OP"oldstring2"newstring2"[modifier] (SPACE) Rename_mask1...

Where (SPACE), or any other separator, separates requests to Rename the current file, until they are all exhausted. Then, the same "program" is called for the next file, etc.

Each request should be recognizable as an OP"old"new" command, or the classic Rename_mask command (or some future variant) and done from left to right. The file name would be renamed repeatedly, but the overhead is minimal, since the Copy or Move would be done once only.

We obtain:

1. Renaming in a single call to Rename, which may be complex, but done in memory!

2. Free mixing of various current and feature Rename techniques in any desired order, until the right substituion is achieved.

3. Extensibility in the future. New commands, very simple, commands, could be added easily in the future to be inserted in the command stream to solve a problem that can't be handled easily by other means. Stupid examples:

... (SPACE) {uppercase_entire_string} (SPACE) ...
... (SPACE) {lowercase_entire_string} (SPACE) ...
... (SPACE) {fallback_to_7-bit_ascii} (SPACE) ...
... (SPACE) {ROT13_current_string} (SPACE) ... (not kidding! -- ZTree PGP?)

4. The current Rename mask is made use of, yet, it won't be impacted or the code
easily broken in this step-by-step process.

> Modifiers (case does not matter):
> N: Replace in name only
> E: Replace in extension only
> B: Replace in the whole file name (no extension separated)
> W: Replace only 'word' ocurrences
> U: Search case sensitive

I would list the above as:

Operators (case does not matter):
N: Replace in name only
E: Replace in extension only
B: Replace in the whole file name (no extension separated)

Modifiers (case does not matter):
W: Replace only 'word' ocurrences
U: Search case sensitive


1,870 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 40 users online (0 registered, 40 guests)
Index | Admin contact |   Forum Time: Mar 28, 2024 - 7:00 pm UTC  |  Hits:62,376,760  (29,157 Today )
RSS Feed