ZTree.com  | ZEN  | About...  

 Index   Back

[ZEP] New Batch Parameters (revised yet again)   [ZEP]

By: John Gruener     Orlando, Florida  
Date: Oct 11,2019 at 15:31
In Response to: [ZEP] New Batch Parameters (Hartmut Schneider)

> Is omitting the leading backslash on non-root paths okay?

I've reconsidered my previous "No" response to this (several times now.) ;-)

After our recent PMs, my final thought on this is yes, it's OK (and preferable) to omit the leading backslashes on the proposed %bf, %bc and %br parameters, as long as ZTree removes the user-specified backslash from \%br when the file is in the entered current Branch directory.

As mentioned previously, while including the leading backslash would be consistent with %3, these %b parameters would not have to be consistent with it. In fact, %bf without the leading backslash would offer an alternative to %3 for any operation that might require the backslash to be omitted. Requiring the user to add the backslash would also make the user's script a bit more readable.

The potential downside to having the user supply the leading backslash is the case of %br (branch relative) when the file happens to be in the root directory entered by the Branch command. In this case %br should be blank. So if the user is supplying the backslash, a double backslash would occur when the \%4.%5 file parameters are added.

However, ZTree is already removing some user-specified characters when necessary. One example is the removal of the period from %4.%5 when there is no extension. Another example is the removal of an extra backslash from %3\%4.%5 when the file is in the root directory of a drive. For these reasons I think it would be consistent for ZTree to remove the user's leading backslash from \%br when it should be blank.

So to summarize, if the directory entered with the Branch command is:
C:\AAA\BBB\CCC

and the file being accessed is in directory:
C:\AAA\BBB\CCC\DDD\EEE\FFF

then:
%b1 = C:\AAA\BBB\CCC\DDD\EEE\FFF
%bf = AAA\BBB\CCC\DDD\EEE\FFF
%bc = CCC\DDD\EEE\FFF
%br = DDD\EEE\FFF

and if the file being accessed is in the entered Branch directory:
C:\AAA\BBB\CCC

then:
%b1 = C:\AAA\BBB\CCC
%bf = AAA\BBB\CCC
%bc = CCC
%br = (blank, including removal of a user-specified leading backslash)

- John

44 views      
 

Messages in this Thread

 
94,499 Postings in 11,924 Threads, 348 registered users, 9 users online (0 registered, 9 guests)
Index | Admin contact |   Forum Time: Oct 23, 2019 - 7:54 pm EDT  |  Hits:28,802,655  (6,403 Today )
RSS Feed