diff --git a/HISTORY b/HISTORY index 302a447d..315af0e2 100644 --- a/HISTORY +++ b/HISTORY @@ -9952,7 +9952,7 @@ Video Disk Recorder Revision History - Added the lines from 'Fixed a timeout in cDvbDevice while tuning after the frontend has been reopened' to cDvbTuner::ProvidesFrontend() (suggested by Markus Ehrnsperger). -2024-08-30: +2024-09-01: - Removed deprecated function cDevice::SetCurrentChannel(const cChannel *Channel). - Removed deprecated function cSkinDisplayMenu::SetItemEvent(const cEvent *Event, int Index, @@ -9978,3 +9978,4 @@ Video Disk Recorder Revision History and select one of them. - Fixed a crash when deleting a recording that is currently being edited, and then immediately deleting the edited version, too (reported by Marko Mäkelä). +- The '.update' file in the video directory is now created if it doesn't already exist. diff --git a/recording.c b/recording.c index b53908dd..e3f52fbe 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 5.29 2024/08/30 20:43:26 kls Exp $ + * $Id: recording.c 5.30 2024/09/01 20:43:40 kls Exp $ */ #include "recording.h" @@ -1631,7 +1631,7 @@ const char *cRecordings::UpdateFileName(void) void cRecordings::TouchUpdate(void) { bool needsUpdate = NeedsUpdate(); - TouchFile(UpdateFileName()); + TouchFile(UpdateFileName(), true); if (!needsUpdate) lastUpdate = time(NULL); // make sure we don't trigger ourselves } diff --git a/tools.c b/tools.c index 77b82389..bb9433c1 100644 --- a/tools.c +++ b/tools.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.c 5.13 2024/07/15 14:42:22 kls Exp $ + * $Id: tools.c 5.14 2024/09/01 20:43:40 kls Exp $ */ #include "tools.h" @@ -719,9 +719,17 @@ bool SpinUpDisk(const char *FileName) return false; } -void TouchFile(const char *FileName) +void TouchFile(const char *FileName, bool Create) { - if (utime(FileName, NULL) == -1 && errno != ENOENT) + if (Create && access(FileName, F_OK) != 0) { // the file does not exist + isyslog("creating file '%s'", FileName); + int f = open(FileName, O_WRONLY | O_CREAT, DEFFILEMODE); + if (f >= 0) + close(f); + else + LOG_ERROR_STR(FileName); + } + if (utime(FileName, NULL) == -1 && errno != ENOENT) LOG_ERROR_STR(FileName); } diff --git a/tools.h b/tools.h index a59b24a8..8a83a1f3 100644 --- a/tools.h +++ b/tools.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.h 5.9 2024/07/15 14:42:22 kls Exp $ + * $Id: tools.h 5.10 2024/09/01 20:43:40 kls Exp $ */ #ifndef __TOOLS_H @@ -319,7 +319,7 @@ bool RemoveEmptyDirectories(const char *DirName, bool RemoveThis = false, const int DirSizeMB(const char *DirName); ///< returns the total size of the files in the given directory, or -1 in case of an error char *ReadLink(const char *FileName); ///< returns a new string allocated on the heap, which the caller must delete (or NULL in case of an error) bool SpinUpDisk(const char *FileName); -void TouchFile(const char *FileName); +void TouchFile(const char *FileName, bool Create = false); time_t LastModifiedTime(const char *FileName); off_t FileSize(const char *FileName); ///< returns the size of the given file, or -1 in case of an error (e.g. if the file doesn't exist) cString WeekDayName(int WeekDay); diff --git a/vdr.1 b/vdr.1 index f0f6eb24..2c0a68e9 100644 --- a/vdr.1 +++ b/vdr.1 @@ -8,7 +8,7 @@ .\" License as specified in the file COPYING that comes with the .\" vdr distribution. .\" -.\" $Id: vdr.1 5.2 2021/12/27 13:31:04 kls Exp $ +.\" $Id: vdr.1 5.3 2024/09/01 20:43:40 kls Exp $ .\" .TH vdr 1 "27 Dec 2021" "2.6" "Video Disk Recorder" .SH NAME @@ -311,8 +311,11 @@ as the first character of the pattern. File names are appended to this file afte a recording has finished, and the entire file is read upon startup of VDR. .TP .I .update -If this file is present in the video directory, its last modification time will -be used to trigger an update of the list of recordings in the "Recordings" menu. +This file (in the video directory) will be touched whenever VDR makes changes +to the content of the directory. Its last modification time will +be used to trigger an update of the list of recordings in any VDRs that use +the same video directory. +The file will be created if it doesn't already exist. .SH SEE ALSO .BR vdr (5), svdrpsend (1) .SH AUTHOR