PDA

View Full Version : Bash question



thesoothsayer
October 1st, 2008, 03:41 AM
When we perform a "-N" test for a file using bash, does bash keep the information about the last time the file was read on a peruser basis or does it just use the last modified time of the file and compare it with the last accessed time?

tomchuk
October 1st, 2008, 04:31 AM
From bash's test.c


case 'N':
return (sh_stat (arg, &stat_buf) == 0 &&
stat_buf.st_atime <= stat_buf.st_mtime);

Looks like it's using the atime and mtime.

thesoothsayer
October 1st, 2008, 06:25 AM
Ah thanks. Where do you get the bash source from?

tomchuk
October 1st, 2008, 01:30 PM
At http://ftp.gnu.org/gnu/bash/ or


apt-get source bash