Re: notification of cd mount
- From: diksa2005@xxxxxxxxxxxxxx
- Date: Sat, 8 Dec 2007 00:41:52 -0800 (PST)
On Dec 6, 1:17 pm, Jan Panteltje <pNaonStpealm...@xxxxxxxxx> wrote:
On a sunny day (12 Sep 2006 02:52:53 -0700) it happened "Himanshu Chauhan"
<hs.chau...@xxxxxxxxx> wrote in
<1158054773.592022.154...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>:
Dear all,
Does linux has any service through which the user application can be
notified about the newly mounted cdrom or filesystem? Any callback
routines? Or the only option is a watchdog type stuff?
Thanks,
Regards
Well, it seems it waits! (likely for a CR or something).
Try this, both for 'ls -rtl' and for 'cat /dev/random'
cat /dev/random will only output when it has gathered enough stuff,
run a couple of times, and wait a long time for output on some occasions.
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv)
{
int a;
FILE *pptr;
//pptr = popen("ls -rtl", "r");
pptr = popen("cat /dev/random", "r");
if(!pptr)
{
fprintf(stderr, "test4: could not open ls -rtl for read, aborting.\n");
exit(1);
}
while(1)
{
a = fgetc(pptr);
if(a == EOF)
{
fprintf(stderr, "test4: EOF detected.\n");
pclose(pptr);
exit(0);
}
fprintf(stdout, "%0x2", a);
}
fprintf(stderr, "WAS HERE, OOOPS.\n");
exit(0);
} /* end function main */- Hide quoted text -
- Show quoted text -
Hi,
You are needed here for your professioner talent as a programmer
and sign up is free.You are going to be collecting contract, work it
at home and recieve your money,click on it now and sign up;
http://www.getafreelancer.com/affiliates/ref.php?u=diksa&l=http://www.getafreelancer.com/projects/PHP-ASP/selling-using-text-message-sms.html
.
- Follow-Ups:
- Re: notification of cd mount
- From: Linonut
- Re: notification of cd mount
- References:
- Re: notification of cd mount
- From: Jan Panteltje
- Re: notification of cd mount
- Prev by Date: Re: Create static library from application
- Next by Date: Advice on reading/learning about Apache Modules
- Previous by thread: Re: notification of cd mount
- Next by thread: Re: notification of cd mount
- Index(es):
Relevant Pages
|