The time now is Mon 20 May 2013, 11:10
All times are UTC - 4 |
| Author |
Message |
sunburnt

Joined: 08 Jun 2005 Posts: 4001 Location: Arizona, U.S.A.
|
Posted: Fri 13 Nov 2009, 20:32 Post subject:
How to intercept an access call to a given directory..? |
|
i want to be able to point access to a directory to other directories.
Like a link does, but I need it to access multiple target directories.
I`ve thought of a few ways of doing this, a kernel module`s the best.
I`ve done some C programming, but that level is beyond my abilities.
System calls can be used to intercept access to files and directories.
Again this is done with C only I believe, I`ve only seen C examples.
Is there a way of making Linux system calls using only Bash script?
I need to stop the directory access and run a script or C program.
It reads a file listing directories to search for the file being accessed.
If the file is found, it is accessed in place of the original file access.
|
|
Back to top
|
|
 |
amigo
Joined: 02 Apr 2007 Posts: 1757
|
Posted: Sat 14 Nov 2009, 18:09 Post subject:
|
|
You'd need to use inotify, fam or gamin to catch the access attempts and then re-direct the paths from there.
|
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 4001 Location: Arizona, U.S.A.
|
Posted: Mon 16 Nov 2009, 00:59 Post subject:
|
|
Thanks amigo; Looking at them, they look to be access notices or loggers.
It doesn`t look like they trap the access and allow you to do something else.
Code sample for inotify:
| Code: | /* File was accessed */
case IN_ACCESS:
printf("ACCESS EVENT OCCURRED: File \"%s\" on WD #%i\n", |
Notice the comments "was" reference and the printf output is "past event" also.
I need to stop the access and run a script that does a "path" search for the file.
This is one method for making a "Multi-Link", a link that has multiple target directories.
A hard link points to files only.
A sym. link points to both files and directories.
A multi. link points to directories only.
It acts like PATH does, except it`s for directories that are not part of the PATH.
The union file system does the same thing also. except it`s complex over kill.
In reading about Linux kernel system calls, it looks like the way to do it.
But I don`t see how to do it except in C...
I really need a new type of link to be written into the kernel. " ln -m " = ( Multi-Link ).
|
|
Back to top
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|
[ Time: 0.0369s ][ Queries: 12 (0.0037s) ][ GZIP on ] |