#define FILE_MISSING 0x08
#define FILE_SELECTED 0x10
#define FILE_SCANNED 0x20
+#define FILE_YOUNG 0x40
/* Macros to define process spawn behaviour as flags */
#define F_NONE 0x00 /* no flag set */
#ifndef NOFIFO
static int fifofd = -1;
#endif
+static time_t gtimesecs;
static uint_t idletimeout, selbufpos, selbuflen;
static ushort_t xlines, xcols;
static ushort_t idle;
}
#endif
-static void print_time(const time_t *timep)
+static void print_time(const time_t *timep, const uchar_t flags)
{
struct tm t;
+ /* Highlight timestamp for entries 5 minutes young */
+ if (flags & FILE_YOUNG)
+ attron(A_REVERSE);
+
localtime_r(timep, &t);
printw("%s-%02d-%02d %02d:%02d",
xitoa(t.tm_year + 1900), t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min);
+
+ if (flags & FILE_YOUNG)
+ attroff(A_REVERSE);
}
static char get_detail_ind(const mode_t mode)
attron(attrs);
/* Print details */
- print_time(&ent->sec);
+ print_time(&ent->sec, ent->flags);
printw("%s%9s ", perms, (type == S_IFREG || type == S_IFDIR)
? coolsize(cfg.blkorder ? (blkcnt_t)ent->blocks << blk_shift : ent->size)
DIR *dirp = opendir(path);
ndents = 0;
+ gtimesecs = time(NULL);
DPRINTF_S(__func__);
#endif
}
+ if ((gtimesecs - sb.st_mtime <= 300) || (gtimesecs - sb.st_ctime <= 300))
+ entflags |= FILE_YOUNG;
+
#if !(defined(__sun) || defined(__HAIKU__))
if (!flags && dp->d_type == DT_LNK) {
/* Do not add sizes for links */
addstr(sort);
/* Timestamp */
- print_time(&pent->sec);
+ print_time(&pent->sec, pent->flags);
addch(' ');
addstr(get_lsperms(pent->mode));