quick confirmation

quick confirmation

Post by Abhina » Sun, 30 May 2004 02:54:07



Hi

Just wanted anyone here to confirm the following related to Linux/Unix
file(systems)

I have a directory (lets say "abc" ) having a lot of
subdirectories/files within it.

I want to be able to know whether abc was used, i.e, any of the
files/directories under it were modified/created/deleted.

1. I can do "ls -ldu abc" and get the access time .
2. If i do a "cat abc/subdir/x.txt" , the access time for abc is also
updated.

I know this is trivial ..but could not find any post/web page which
actually details this ..

Many thanks
AB

 
 
 

quick confirmation

Post by Barry Margoli » Sun, 30 May 2004 06:34:48




> Hi

> Just wanted anyone here to confirm the following related to Linux/Unix
> file(systems)

> I have a directory (lets say "abc" ) having a lot of
> subdirectories/files within it.

> I want to be able to know whether abc was used, i.e, any of the
> files/directories under it were modified/created/deleted.

> 1. I can do "ls -ldu abc" and get the access time .

Correct.

Quote:> 2. If i do a "cat abc/subdir/x.txt" , the access time for abc is also
> updated.

Correct.  Anything that reads the names in a directory will update the
directory's access time.

--

Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

 
 
 

quick confirmation

Post by Abhina » Sun, 30 May 2004 06:55:34



> Hi

> Just wanted anyone here to confirm the following related to Linux/Unix
> file(systems)

> I have a directory (lets say "abc" ) having a lot of
> subdirectories/files within it.

> I want to be able to know whether abc was used, i.e, any of the
> files/directories under it were modified/created/deleted.

> 1. I can do "ls -ldu abc" and get the access time .
> 2. If i do a "cat abc/subdir/x.txt" , the access time for abc is also
> updated.

maybe not  .. 2. above did not update the atime for abc on mu Linux
system ..

- Show quoted text -

Quote:> I know this is trivial ..but could not find any post/web page which
> actually details this ..

> Many thanks
> AB

 
 
 

quick confirmation

Post by Charles Harrison Caudil » Sun, 30 May 2004 13:43:43



> I have a directory (lets say "abc" ) having a lot of
> subdirectories/files within it.
> I want to be able to know whether abc was used, i.e, any of the
> files/directories under it were modified/created/deleted.

What you're asking is actually implementation defined.

For example, if I wrote my readdir function in the file_operations struct in
the filesystem driver for Linux, to update the access time whenever it was
simply looked at, then that could happen.

Quote:> 1. I can do "ls -ldu abc" and get the access time .
> 2. If i do a "cat abc/subdir/x.txt" , the access time for abc is also
> updated.

as for what actually happens:  I experimentally verified that access times are
only updated when there is a modification to the inode using an x86, running
the 2.6.5 kernel with an ext3 partition.  So, for the case of a directory, the
access time is updated when a dentry is created or destroyed.

Quote:> I know this is trivial ..but could not find any post/web page which
> actually details this ..

we all know the pain

If you are still confused on filesystem operations, then check out a few
things, the O'Reilly Linux kernel book, and the ramfs, minix, and ext2 fs code
on http://lxr.linux.no

HTH

--
Harrison Caudill                        |  .^        www.hypersphere.org
Computer Science & Physics Double Major |  | Me*Me=1
Georgia Institute of Technology         | v'         I'm just a normal guy

 
 
 

quick confirmation

Post by Icarus Sparr » Mon, 31 May 2004 05:07:52





>> Hi

>> Just wanted anyone here to confirm the following related to Linux/Unix
>> file(systems)

>> I have a directory (lets say "abc" ) having a lot of
>> subdirectories/files within it.

>> I want to be able to know whether abc was used, i.e, any of the
>> files/directories under it were modified/created/deleted.

>> 1. I can do "ls -ldu abc" and get the access time .

> Correct.

>> 2. If i do a "cat abc/subdir/x.txt" , the access time for abc is also
>> updated.

> Correct.  Anything that reads the names in a directory will update the
> directory's access time.

Unless
1) The file system is mounted read-only, or
2) Some idiot, in the name of "efficiency" has got a hacked filesystem
with a "noatime" mount flag.

As far as 2 goes, yes it might reduce the amount of disk accesses, but any
saving is more than wiped out when someone is trying to figure out why
something is not being accessed, using the fact that the atime is not
updated.

 
 
 

1. Need quick confirmation: AIC7850 in MB is supported and runs?

Need a yes/no here, dear reader, telling me that Yes, you have indeed
operated a Pentium Motherboard with the AIC7850 embedded scsi driver,
and that you can verify that it runs perfectly and underfull support
from Linux 2.0.0 drivers.... or NO that you have NO idea whether they go
or not.

        Comments are also welcome.  Please respond via mail.

--
 - Lionel R 'bishop' Clark

        News 'admin' Online Communications (Cahill Vivecon) I$P

2. Networking pauses/timeouts

3. Quick money - quick.mon [01/01]

4. Configuring connectivity

5. I have a Quick Question, need quick answer.

6. Configuring sendmail to recognize other sites on the lan.

7. Need a Hayes modem buy confirmation

8. Linux and Excite for Web Servers 1.1 - Install Problems

9. Output confirmation in a script

10. drive check hangs on startup and asks for user confirmation ?!

11. DB2 for Linux? Need confirmation!

12. Q: Deleting files without confirmation

13. Obtaining confirmation for sent data