[comp.binaries.ibm.pc.d] Looking for a "move directory" utility

lane@cs.dal.ca (John Wright/Dr. Pat Lane) (10/06/90)

Hi.  I've collected hundreds of utilities over the years but there's one
that I've been waiting for, been really needing, but have never seen (and
of course have been to lazy to write myself :-).

What I want is something to simply move a sub-directory entry from one
directory to another.  I use RED, originaly from PC-Magasine, for moving
files but it won't touch directories.  RED simply calls a DOS function
(56h, I think) that does all the work...presumably it doesn't like
directories.  To move a directory, not only would you have to move the 
directory entries, but you would have to alter the first block of the
moved directory to change the starting cluster number of the ".." entry.
I've done it with Norton's enough times, it should be possible for a
program to do.

Another way to do it would be to use the method of RED but make it do a
recursive directory sweep (ie. an "/s" parameter).

Surely there must be something out there to do this?  If not, anyone
want to hack it together?

Sorry for the cross-posting, I'm still getting the hang of all these new
groups.

-- 

John Wright      //////////////////     Phone:  902-424-3805  or  902-424-6527
Post: c/o Dr Pat Lane, Biology Dept, Dalhousie U, Halifax N.S., CANADA B3H-4H8 
Internet: lane@cs.dal.ca   Uucp: lane@dalcs.uucp or {uunet watmath}!dalcs!lane

gordon@osiris.cso.uiuc.edu (John Gordon) (10/07/90)

	Well, I think that the 'mv' command in the MKS Toolkit does what you
want.  However, it is not free, but commercial software.  But, perhaps other
versions of 'mv' from PD sources will also work.

jaz@icd.ab.com (Jack A. Zucker) (10/08/90)

In article <1990Oct6.180133.2037@ux1.cso.uiuc.edu>,
gordon@osiris.cso.uiuc.edu (John Gordon) writes:
> 
> 	Well, I think that the 'mv' command in the MKS Toolkit does what you
> want.  However, it is not free, but commercial software.  But, perhaps other
> versions of 'mv' from PD sources will also work.

No, the MKS mv will not move a directory to another path. You can rename the
directory but you cannot perform true directory moves such as the following:

mv /usr/home /

I wish you could do this sort of thing from MKS however. I certainly would
be interested if someone comes up with a utility to do it. With MKS I usually
perform the following inefficient steps:

cp -r /usr/home /
rm -rf /usr/home

Of course it's painfully slow. I want a move that moves only the directory
entries. Of course, I've seen utilities that performed a recursive copy, then
a recursive delete such as the previous example.

-Jaz


| Jack A Zucker	                 {cwjcc,pyramid,decvax,uunet}!jaz@icd.ab.com |
| Allen-Bradley Company, Inc.     or                       ICCGCC::ZUCKER    |
| 747 Alpha Drive                 
| Highland Hts., OH 44143         phone: (216) 646-4668   FAX: (216)
646-4484 | 

mvolo@uncecs.edu (Michael R. Volow) (10/08/90)

Not sure if you want a utility to move just the files in a directory,
or to move the directory itself. I've seen (and used) several PD 
MV utilities (can E-mail if you're interested).

If however you want to move a piece of subdirectory tree (complete with
files) then you want a prune and graft utility. PC TOOLS and PC MAG
utilities both have such a function.
-- 
Michael Volow, Psychiatry, Durham VA Med Center, Durham NC 27712
919 286 0411 Ext 6933               mvolo@ecsvax.edu

mcc@WLV.IMSD.CONTEL.COM (Merton Campbell Crockett) (10/10/90)

There are several programs that will do what you want.  For example, the
PKZIP/PKUNZIP pair can be used to archive a tree starting at some arbitrary
branch or is it root since it archives all the twigs or root hairs above
or below the starting point.  PKZIP is used to create the archive--the
switches are documented in the help screen--and it will remove the files
and directories that are archived.  Move to the desired directory and use
PKUNZIP to restore the files and directory structure in the new location.

Another program I ran accross years ago was a program called Directory
Maintainer which among its attributes was that it would work on a Tandy 2000
as well as an IBM PC.  As I recall, you could mark all the files in a dir-
ectory and then move them to another directory.  If the directory did not
exist it would create the directory when requested.  The only restriction
that I recall was that only the last directory in the target path could be
non-existent.

Merton

andy@mks.com (Andy Toy) (10/11/90)

In article <1900@abvax.UUCP> jaz@icd.ab.com (Jack A. Zucker) writes:
>gordon@osiris.cso.uiuc.edu (John Gordon) writes:
>> Well, I think that the 'mv' command in the MKS Toolkit does what you want.  
>
>mv /usr/home /  # does not work

This is not always so.  I noticed that it is possible to do this on a
NFS mounted drive on a DOS machine when using PC-NFS.

>I wish you could do this sort of thing from MKS however. I certainly would
>be interested if someone comes up with a utility to do it. With MKS I usually
>perform the following inefficient steps:
>
>cp -r /usr/home /
>rm -rf /usr/home
>
>Of course it's painfully slow.

mv -r /usr/home /

This will work the same as the above, but is still very slow.
I think the `-r' option is a recent addition.
-- 
Andy Toy, Mortice Kern Systems Inc.,       Internet: andy@mks.com
  35 King Street North, Waterloo,       UUCP: uunet!watmath!mks!andy
      Ontario, CANADA N2J 2W9      Phone: 519-884-2251  FAX: 519-884-8861

jaz@icd.ab.com (Jack A. Zucker) (10/11/90)

In article <59109@wlbr.IMSD.CONTEL.COM>, mcc@WLV.IMSD.CONTEL.COM (Merton
Campbell Crockett) writes:
> There are several programs that will do what you want.  For example, the
> PKZIP/PKUNZIP

I think you missed the point. You can copy the files over using 
xcopy <dirname> <destination> /s

It's the functionality of mv <dirname> <destination> that moves the file
directory data without having to move the files actual data. This is a big
difference! 

-Jaz


| Jack A Zucker	                 {cwjcc,pyramid,decvax,uunet}!jaz@icd.ab.com |
| Allen-Bradley Company, Inc.     or                       ICCGCC::ZUCKER    |
| 747 Alpha Drive                 
| Highland Hts., OH 44143         phone: (216) 646-4668   FAX: (216)
646-4484 | 

umrose05@ccu.umanitoba.ca (Dave Rose) (10/12/90)

In regards to your message, I have such a utility, and it works great!

Dave (umrose05@ccu.umanitoba.ca)

*grin*


-- 
Dave Rose                 : Local (UnixWS) - UMRose05@CCU.UManitoba.CA
P.O. Box 403              : Local (Amdahl) - #Rose05@CCM.UManitoba.CA
Winnipeg, Manitoba, Canada: UUCP Node #005 - drose@trash.UUCP
R2M-5H3                   :