directory alias bug?

I have a directory alias:

alias hu*tils:=c:\_\HUtils\

The definition is accepted, but when I use it only the full form (e.g., dir hutils:) works; the abbreviated (e.g., dir hu:) versions do not. I don't see anything in the help saying that abbreviation cannot be used in directory aliases.
 
Jun 2, 2008
373
2
Newton, MA
> the abbreviated (e.g., dir hu:) versions do not. I
> don't see anything in the help saying that
> abbreviation cannot be used in directory aliases.

In fact, abbreviations don't work because of the requirement to have a
colon. With your definition, "hu*tils:=c:\_\HUtils\", you would have to
issue the command as "dir hu" with no colon, since "hu:" does not match
the beginning characters of "hutils:".

I wish that Rex had made directory aliases distinct from command aliases
(loaded into a separate memory space). Then one could define a directory
alias

diralias hu*tils=c:\_\HUtils\ (note: no colon in the alias name)

Then the expressions hu:, hut:, hutil:, etc. would all match that
abbreviated directory alias, with the terminating colon being the signal
to check the directory alias definitions. By storing the directory
aliases together with the command aliases, I suspect it is really hard
to deal with abbreviations of directory aliases.

What I do is define a whole series of directory aliases:

hu:=dirname
hut:=dirname
huti:dirname
(etc.)

It's slightly tedious, but it works.

-- Jay
 

rconn

Administrator
Staff member
May 14, 2008
12,315
148
> I have a directory alias:
>
> alias hu*tils:=c:\_\HUtils\
>
> The definition is accepted, but when I use it only the full form (e.g.,
> dir hutils:) works; the abbreviated (e.g., dir hu:) versions do not. I
> don't see anything in the help saying that abbreviation cannot be used
> in directory aliases.

You cannot use abbreviations in directory aliases. (There's nothing in the
help that says you *can* use abbreviations!)

If I could do it over, I would eliminate all abbreviated alias support, as
IMO it provides a miniscule benefit for a miniscule number of users, while
greatly complicating expansion.

Rex Conn
JP Software
 
May 20, 2008
11,288
95
Syracuse, NY, USA
On Wed, 25 Nov 2009 19:31:09 -0600, rconn <> wrote:

|---Quote---
|> I have a directory alias:
|>
|> alias hu*tils:=c:\_\HUtils\
|>
|> The definition is accepted, but when I use it only the full form (e.g.,
|> dir hutils:) works; the abbreviated (e.g., dir hu:) versions do not. I
|> don't see anything in the help saying that abbreviation cannot be used
|> in directory aliases.
|---End Quote---
|You cannot use abbreviations in directory aliases. (There's nothing in the
|help that says you *can* use abbreviations!)
|
|If I could do it over, I would eliminate all abbreviated alias support, as
|IMO it provides a miniscule benefit for a miniscule number of users, while
|greatly complicating expansion.

I've never used it in fifteen years or so. What's the point? Why use (and
remember) anything longer than the shortest form?
--
- Vince
 
Jun 2, 2008
373
2
Newton, MA
> I've never used it in fifteen years or so.

I, on the other hand, have used it extensively.

> What's the point? Why use (and remember) anything
> longer than the shortest form?

I find it's easier and more reliable to remember long, self-descriptive
command names, and then to use shorter forms. If I'm not sure I remember
the short form, I can always use the long one.

On the other hand, I think that Rex is correct: we really could do
without them. Today's computers have tons of memory, so who cares if we
have to define several versions of an alias. So instead of defining, for
example

plugl*oad=*plugin /L ...

one can define

plugload=*plugin /L ...
plugl=plugload

Not only do we have tons of memory, but computers are so fast that the
extra processing time to handle the larger number of aliases is negligible.

-- Jay

P.S. I should have used that same approach in my previous directory
alias example.

hu:=c:\_\HUtils\
hut:=hu:
huti:=hu:
hutil:=hu:
hutils:=hu:

This way the whole set of definitions can be changed on one line.
 
Similar threads
Thread starter Title Forum Replies Date
Jay Sage Directory Alias Access to FTP Servers Support 2
Joe Caverly Using a Directory Alias with @iniwrite fails Support 14
cgunhouse Directory Alias Issue Support 7
J Initialise; Alias; Extended directory search Support 2
fishman@panix.com HELP!! I just updated to Version 28 and as usual I cannot make extended directory search work. Support 2
D How to use multi-line DO to loop through first level directory names Support 5
D ParentDirectory does not update directory history Support 6
samintz CDD to non-existent directory hangs Support 2
gworley rd (Remove Directory) gives interesting error: Support 2
D Directory History Window with wildcard search Support 3
D How to? Skip removing directory (RMDIR) without error message Support 2
gentzel Directory stack empty when running TCEXIT? Support 9
vefatica Disable extended directory searches (completely)? Support 8
M WAD "Pictures" directory is empty in TCC but not in CMD or Explorer Support 4
G Local Directory Corruption Support 11
Joe Caverly DIRectory Colorization in v25 Help File Support 0
K copy changing destination current directory Support 1
thorntonpg option /u not working The directory name is invalid Support 5
J built in file explorer - how do i go back "up" the directory? Support 2
vefatica Extended directory searches? Support 6
A Installer /extract: extracts into current directory if target not exists Support 12
Charles Dye Ctrl-Shift-Up doesn't update directory history Support 1
G Extended directory search not working Support 4
CWBillow Editing in the root directory of windows 10 Support 6
D Directory stack empty Support 1
J directory or folder to start in Support 2
M How to unlock a directory Support 1
Alpengreis Fixed TCMD FileExplorer Start-Directory problem Support 4
R V19 - At startup, TCC save directory in the directory history list Support 2
C Touch command — I Need to touch matching files in another directory. Support 5
nickles Move takecommand.18.0.key location to installation directory Support 4
fishman@panix.com Extended Directory Searches are not working for me in CDD Support 9
vefatica TCMD's current directory? Support 4
J How to set working directory Support 10
nickles How to? Follow a JUNCTION type directory link Support 9
Steve Pitts WAD Strange output from DEL of a non-existent directory Support 7
I tab completion with directory commands Support 7
vefatica Start-up directory for new tabs? Support 7
cgunhouse Problem with CALL and Directory Aliases in V17 Support 9
vefatica FFIND /S, find directory with specified name? Support 7
David Wilbanks How to make new tab open in same directory as previous tab? Support 4
H WAD Wild Card in Directory @shfolder[25] acting differently Support 3
M How to? List path getting short file and directory names... Support 10
A How to? Can't change directory ("cd") into system hidden files Support 13
mfarah How to? So I want a custom directory for the plugins... Support 16
D Why doesn't ffind find directory? Support 3
T dir /h error in empty directory Support 22
S directory history locks up TCC Support 3
B Why Does @GETDIR Repeat Selected Directory Name In Returned Value Support 7
ed neff How to? exit TCC/Take Command to a new directory Support 10

Similar threads