[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dired Problems



    Date: Mon, 5 Mar 90 14:28:53+0900
    From: kddlab!atr-la.atr.co.jp!myers@uunet.UU.NET (John K. Myers)

    My immediate problem:  I have a huge number of files in a directory.
    I would like to move a large subset of these into a new directory.
    There are too many files to comfortably "Rename" each by hand; I require
    a way to do this automatically.  I assume that this operation is routine
    and basic, and should be well-supported.
      After reading the Dired manual (v.3, pp. 163-173) carefully for ten minutes,
    I can find no way to do this.  (Normally, it takes me a day of chasing down
    all possible references before I find out something's undocumented...)
    Can anyone help me out with this problem?

Try marking each file you wish to process with the "A" command. You can use
a keyboard macro to mark multiple files with A.

When you have the files to process, Q dired. Dired will prompt you if the
files are correct, and if you tell it to process them, it will ask for a
function.

Give it the function

(lambda (file) (rename-file file
"New-host:>new-directory>more-new-directory>"))

This should do what you want. Obviously the new path should conform to the
physical path the new-host likes, or you should use a logical pathname. Note
that no file is specified; rename file will default to the old filename, by
using the merging rules appropriate for the host(s) involved.