unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Xavier Maillard <zedek@gnu-rox.org>
Subject: Howto rename a file
Date: Tue, 06 Dec 2005 01:02:51 +0100	[thread overview]
Message-ID: <E1EjQIF-0002zE-Fa@localhost.localdomain> (raw)

Hello,

Given the situation I have files in a directory such as foo-1, foo-2
...

When I use an Emacs batch session, I want these files to be renamed
as bar-1, bar-2 and so on.

In certain cases, I may have other files named foo-1 that should be
renamed, following this logic, as bar-1. What I want is that if a
file bar-1 already exists, then the file should be renamed as
bar-<n> where <n> is a unique number following the maximum found
in the directory.

So foo-1 will be renamed as bar-3 in my example.

How would you do that ?

Thank you

Xavier

                 reply	other threads:[~2005-12-06  0:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1EjQIF-0002zE-Fa@localhost.localdomain \
    --to=zedek@gnu-rox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).