primary and secondary CWD

#1
This has bothered my since 4DOS days.

DOS/Windows has the concept of a CWD, current working directory, but what you really want is a SOURCE CWD and TARGET CWD or Primary/Secondary CWD.

Then any thing that worked across directories or directory trees would be much simpler.

copy x.txt y.txt

instead of copy E:\a\b\c\x.txt F:\bks\a\b\c\y.txt

if prime:x.txt exists if exist sec:t.txt echo dup t

I am not sure quite what syntax you would need to indicate primary and secondary that would not break existing scripts.

You can do things like
set source=xxx
set target=yyy
if %source\x.txt exists if exist %target\t.txt echo dup t

I just wondered what might be possible be build the concept in more smoothly. I originally envisioned something like QDOS or Magellan with a source and target panel so it was always visually clear which directories would be acted upon when you say selected some files for copy.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,725
47
Albuquerque, NM
prospero.unm.edu
#2
This has bothered my since 4DOS days.

DOS/Windows has the concept of a CWD, current working directory, but what you really want is a SOURCE CWD and TARGET CWD or Primary/Secondary CWD.

Then any thing that worked across directories or directory trees would be much simpler.

copy x.txt y.txt

instead of copy E:\a\b\c\x.txt F:\bks\a\b\c\y.txt

if prime:x.txt exists if exist sec:t.txt echo dup t

I am not sure quite what syntax you would need to indicate primary and secondary that would not break existing scripts.
Have you looked into directory aliases?
 

samintz

Scott Mintz
May 20, 2008
1,313
11
Solon, OH, USA
#3
You could use directory aliases to accomplish that.

alias s1:=c:\dir1\dir2\dir3
alias s2:=d:\dir1\dir2\dir3

copy /s s1:x.txt s2:y.txt

if isfile s1:x.txt .and. isfile s2:y.txt echo dup x.txt

-Scott

Roedy <> wrote on 11/10/2011 11:05:39 AM:


> This has bothered my since 4DOS days.
>
> DOS/Windows has the concept of a CWD, current working directory, but
> what you really want is a SOURCE CWD and TARGET CWD or Primary/Secondary
CWD.

>
> Then any thing that worked across directories or directory trees
> would be much simpler.
>
> copy x.txt y.txt
>
> instead of copy E:\a\b\c\x.txt F:\bks\a\b\c\y.txt
>
> if prime:x.txt exists if exist sec:t.txt echo dup t
>
> I am not sure quite what syntax you would need to indicate primary
> and secondary that would not break existing scripts.
>
> You can do things like
> set source=xxx
> set target=yyy
> if %source\x.txt exists if exist %target\t.txt echo dup t
>
> I just wondered what might be possible be build the concept in more
> smoothly. I originally envisioned something like QDOS or Magellan
> with a source and target panel so it was always visually clear which
> directories would be acted upon when you say selected some files for
copy.