Hello Shakthi,
But does it allow me to add or delete contents in file like as usual normal file(I KNOW U SAID PROC FILE). What i want to update contents of file periodically from user programs? Does /proc allows to do that thing to me???
But does it allow me to add or delete contents in file like as usual normal file(I KNOW U SAID PROC FILE). What i want to update contents of file periodically from user programs? Does /proc allows to do that thing to me???
regards,
linux_lover.
On Mon, 13 Sep 2004 Shakthi Kannan wrote :
>Hi!
>
> > > You said that you want to create a file at loading
> > > time and want to
> > > remove that file forom file system at unloading
> > > time
>
>Why not use the /proc filesystem for this? It is quite simple.
>
>Example:
>
>int scull_read_procmem (char *buf, char **start, off_t offset, int
>count, int *eof, void *data) {
> int len = 0;
> len += sprintf (buf+len, "\nFrom scull_read_procmem");
> return len;
>}
>
>static void scull_create_proc() {
> create_proc_read_entry ("scullmem",
> 0,
> NULL,
> scull_read_procmem,
> NULL);
>}
>
>Regards,
>
>Shaks
>
>--
>Kernelnewbies: Help each other learn about the Linux kernel.
>Archive: http://mail.nl.linux.org/kernelnewbies/
>FAQ: http://kernelnewbies.org/faq/
>
>Hi!
>
> > > You said that you want to create a file at loading
> > > time and want to
> > > remove that file forom file system at unloading
> > > time
>
>Why not use the /proc filesystem for this? It is quite simple.
>
>Example:
>
>int scull_read_procmem (char *buf, char **start, off_t offset, int
>count, int *eof, void *data) {
> int len = 0;
> len += sprintf (buf+len, "\nFrom scull_read_procmem");
> return len;
>}
>
>static void scull_create_proc() {
> create_proc_read_entry ("scullmem",
> 0,
> NULL,
> scull_read_procmem,
> NULL);
>}
>
>Regards,
>
>Shaks
>
>--
>Kernelnewbies: Help each other learn about the Linux kernel.
>Archive: http://mail.nl.linux.org/kernelnewbies/
>FAQ: http://kernelnewbies.org/faq/
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com