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

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.

Well, if the files to be operated on all match a particular wildcard,
the CP command Rename File can often be used, e.g.

Command: Rename File SERVER:>barmar>*.old.* SERVER:>barmar>old-stuff>*.*.* 

If this method can't be used then I usually write Lisp code to do it.

      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?

    Related problems:
    (1) Apparent typo at bottom of p.172, 8th line from end:  The command is listed
    as "Applying Arbitrary Functions to Files  ." in bold face.  However, the "."
    command is also listed as "Dired Change File Properties".  Take the bold "." out?

    (2) The obvious method for copying, renaming, changing file properties, etc., of
    multiple files, is to "select" all the desired files, and then to do a single
    operation on them.  One method of "selecting" a set of files is to put an "A" in
    front of each desired file.  A second method of "selecting" is to do a C-@ to
    mark a point, and then C-N to move through a contiguous region of files.  This
    underlines the apparently selected files.  Following through with an "R" does not
    work for either method.

c-@ merely sets the mark, just as in normal text buffers.  It ignores
the structure of special-purpose buffers such as Dired buffers.

    (3) There is no apparent way to select noncontiguous file-names with C-@.

That's part of Zwei's general concept of the region, which is simply the
part of the buffer from the last mark you set to the current position.

    (4) There is no apparent way to "Apply a Function" once the files have been
    selected using "A".  There is no example given.  In the v3 manual, the only entries
    for Applying a Function in the index point to p.172, there are no other entries
    in the index.  How do I invoke the function?  m-X Apply Function does not work.
    m-X Dired Apply Function does not work.  (Note it is also unclear how to write
    a function that renames a file, even if I could Apply it.)

The "Q" and "I" commands perform all the "marked" operations (deleting
files marked for deletion, printing files marked for printing, applying
functions, etc.).

    (5) I perceive a paradigm gap between some Dired functions, which operate
    directly on the current/selected file, and other Dired functions, which do not
    operate immediately but instead select or mark the file to be processed later.
    I wish that all of the commands followed the same paradigm.  Perhaps there
    could be a generic select that chooses a number of files for processing,
    and then the particular command could tell what to do with them.  If no series
    of files is selected, the command could still operate on the current file.
    I realize due to historical reasons this will probably not change, but
    the designers should be aware of this.

I think the idea is that fast, non-destructive operations are performed
immediately.  This includes renaming, copying, and setting attributes.
Slow operations include hardcopy and function application, so these are
deferred.  Dangerous operations are deletions, so these are deferred so
that a query can be given.

                                                barmar