Browse Prior Art Database

Folder Redirect and Filtering Disclosure Number: IPCOM000199927D
Publication Date: 2010-Sep-21
Document File: 5 page(s) / 106K

Publishing Venue

The Prior Art Database


With the solution that we are providing, user can maintain and organize his Folders and Files In a structural order with minimal overhead. The type of redirection of Folders can also be prioritized.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 56% of the total text.

Page 1 of 5

Folder Redirect and Filtering

Algorithm for the proposed solution:

Commands like cp and install, opens the source and destination file using the open system call. The data from the source is copied to the destination by repeatedly calling the read followed by write, system calls. This process involves copying the data in the file from kernel memory space to the user memory space and back again.

Now the copying is done by the kernel upon calling read or writes but on some operating

systems, this has moved entirely in to the kernel replacing the copy operation with an equal system call.

In case of File-transfer through a socket, read and write to a socket is made or sendfile() system-call is used


   : The sendfile system call is a relatively recent addition to the Linux kernel that offers significant performance benefits to applications such as ftp and web servers that need to efficiently transfer files
From the above, we have an inference that copying is performed via system-call.

Our Algorithm:

We write a Wrapper to the System calls which will own the responsibility to copy. The

procedure for creating a wrapper varies from OS to OS. Following is an example for creating a

wrapper for write system call, on Linux:

Before a write happens to a folder, the kernel checks for user permission for read and write to that particular folder. If there is write permission then we have to see if the Redirect Flag is set?

If the redirect flag is set, then enable the wrapper that is written to override the path settings in the redirect window

How we do it:

There is a system data structure called struct stat ; which is used to maintain the re-direct information/settings as provided by the user.

Along with this, we also maintain a separate data structure separately that gives the permission's through the second operation getOriginalPath(fd).

Code snippet:
Lets create a File IBM.cpp






Page 2 of 5





#define size 1024



t write(int fd, const void *buf, size


t count)


int (*pointer


write) (int fd, const void *buf, size


t count)=NULL;

char * Originalpath;

struct stat structbuff;




//This option is currently not maintained by the stat



*Originalpath= getOriginalPath(fd);



_write = dlsym(RTLD


File *fdo= open(Originalpath, O



buf ,count);

return getOriginalPath(fd).size(); }

Compiling above code snippet: cc -fPIC -D


_SOURCE -c IBM.cpp

cc -sh

Usage: export LD


#execute the write paste operation will call the above function ,and the file is copied to a different destination.
export LD


fd = pointer


The functions getOriginalPath() and size can be returned by maintaining a HashMap, for all folders where File/Folder type is a key and target folder is value.


Page 3 of 5


ยท If a folder itself i...