Find the answer to your Linux question:
Results 1 to 6 of 6
I am using ext2 file system on linux-2.6.26. i want to know whether the file system keeps a record of the absolute pathname for each and every file that have ...
  1. #1
    Just Joined!
    Join Date
    Feb 2009
    Posts
    13

    Exclamation finding absolute pathname

    I am using ext2 file system on linux-2.6.26. i want to know whether the file system keeps a record of the absolute pathname for each and every file that have been created. if so, where could i find it.

  2. #2
    Linux User
    Join Date
    Jan 2006
    Posts
    414
    No, a record like that isn't needed as long as each directory knows it's contents.

    Why do you need to know the absolute path?

  3. #3
    Just Joined!
    Join Date
    Feb 2009
    Posts
    13
    i need to know that because if i need to keep track of each and every file created. with help of the absolute address, i can easily perform path walk the file.
    or else, can anyone tell me how to keep track of each and every file that has been created.

  4. #4
    Just Joined!
    Join Date
    Feb 2009
    Posts
    2

    Thumbs up filesystem

    hi,i am currently working in ext2 file systems.i need to know how to get the absolute pathname of a file.can anyone help?

  5. #5
    Just Joined!
    Join Date
    Feb 2009
    Posts
    45
    Quote Originally Posted by veda87
    or else, can anyone tell me how to keep track of each and every file that has been created.
    You could intercept the «open»-libc-call via preloading. Keywords: ld, LD_PRELOAD. This effect can be globalised by:
    Code:
    $> man 8 ld.so
          …
          /etc/ld.so.preload
                File containing a compiled list of directories in which to search for libraries and an ordered list of candidate libraries.
          …
    However this approach has a fatal flaw: it does not track file creations that bypass the use of libc-«open» but directly use the «open»-syscall. The only solution to that problem that currently comes to my mind would be to directly manipulate the responsible kernel code.

  6. #6
    Just Joined!
    Join Date
    Feb 2009
    Posts
    13
    i got the absolute pathaname.... i got it through the function
    char *dentry_path(struct dentry *dentry, char *buf, int buflen) which is defined in fs/dcache.c

    it gives the pathname of the file from the root of the filesystem.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...