lkml.org 
[lkml]   [1997]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: New feature
Date

> > >
> > > ls -F will access the files. check that you don't alias ls to 'ls -F'
> > >
> > Yes! `ls` is aliased to `ls -AF`. Don't know why. I just removed it from
> > .bashrc.
>
> Hmm, my man says
> -F, --classify
> Do not know why this should touch files.

I guess I should have been a little clearer. -F requires that ls
stat() every file in the directory. stat() means every file's inode
will be accessed. ie. a lot more disk accesses than just reading the
directory. Andreas Schwab has correctly pointed out that stat()
doesn't update atime for a file. Sorry for the confusion.

If file atimes are changed, that's a bug. Try the following a number
of times, giving the same file as a command line arg.

#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
while (--argc > 0)
{
struct stat buf;
if (stat(*++argv, &buf) == 0)
printf("%ld\n", buf.st_atime);
}
return 0;
}

\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.087 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site