Mailing List archive

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

[vdr] Re: renaming recordings



Gerhard Steiner <steiner@mail.austria.com> wrote:
> vdr is storing this information within the directory name.
> Does anyone know how to change the directory name using
> c/c++?
> Now I am using a "mv" command.
> But isn't there a better way?

I think there is a much better way. I'm looking for this problem since
a few days, too.
Take a look at the delete-function. There the recording is renamed to
RECODERING+.del . Renaming recodrings to HansPeter1 is very similar I
think.

I defined a new function "Rename(*TargetNewName)" in recording.c
It is copied from the delete:

// TK Neue Funktion zum Umbenennen
bool cRecording::Rename(char *TargetNewName)
{
  bool result = true;
  char *OldName = strdup(FileName());
  char *NewName = strdup(FileName());
  char *ext = strrchr(NewName, '.');
  if (strcmp(ext, RECEXT) == 0) {
     strncpy(ext, DELEXT, strlen(ext));
     if (access(NewName, F_OK) == 0) {
        // the new name already exists, so stop renaming:
                isyslog("stop renaming %s to %s", OldName, TargetNewName);
     }else{
                isyslog("renamin %s to %s", FileName(), TargetNewName);
                result = RenameVideoFile(FileName(), TargetNewName);
     }
  free(NewName);
  return result;
}

My problem is, how to get the new recording-name. I'm looking for a
new screen like the edit-option for Timers or something like this.

The problem is, i don't have great knowledge of c/c++, so the work is
very hard :/


I hope it may help someone who does know more of this.

Torsten

p.s. sorry for my bad English


-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index