Re: [SLE] directory listing daemon ?

From: Laurent Renard (lrenard_at_epicuria.be)
Date: 04/30/05

  • Next message: Kevanf1: "Re: [SLE] Installation of SuSE 9.2 on an older Box"
    Date: Sat, 30 Apr 2005 23:21:07 +0200
    
    

    Le samedi 30 avril 2005 à 20:24 +0200, Anders Johansson a écrit :
    > On Saturday 30 April 2005 19:03, Laurent Renard wrote:
    > > Hello everyone,
    > >
    > > i'm looking for something that could listen to a directory content
    > > ( console )
    > > and dynamicaly display it ( and display changes in real-time )
    >
    > watch ls directory
    >
    > perhaps?
    >
    > Or if you want it to be closer to real time, a simple program that uses the
    > file alteration monitor would do it. Something like this (hacked together in
    > about 5 minutes, to give you the general idea)
    >
    > #include <stdio.h>
    > #include <fam.h>
    > #include <sys/types.h>
    > #include <dirent.h>
    > #include <sys/select.h>
    >
    > int main(int argc, char *argv[]){
    > FAMConnection fc;
    > FAMRequest fr;
    > FAMEvent fe;
    > DIR *dir;
    > struct dirent *entry;
    >
    > printf("Monitoring directory %s\n", argv[1]);
    >
    > if(FAMOpen(&fc)){
    > fprintf(stderr, "Couldn't open connection to FAM daemon\n");
    > exit(1);
    > }
    >
    > if(FAMMonitorDirectory(&fc, argv[1], &fr, NULL))
    > exit(1);
    >
    > while(FAMNextEvent(&fc, &fe) != -1){
    > printf("The directory changed\n");
    > dir = opendir(argv[1]);
    > while((entry = readdir(dir)) != NULL)
    > printf("%s\n", entry->d_name);
    > closedir(dir);
    > }
    > FAMClose(&fc);
    > return 0;
    > }

    It seems that i need a few more libs to execute it or is there a place
    where i could drop it to run ?

    -- 
    Laurent Renard
    -- 
    Check the headers for your unsubscription address
    For additional commands send e-mail to suse-linux-e-help@suse.com
    Also check the archives at http://lists.suse.com
    Please read the FAQs: suse-linux-e-faq@suse.com
    

  • Next message: Kevanf1: "Re: [SLE] Installation of SuSE 9.2 on an older Box"

    Relevant Pages

    • [SLE] Juvenile antics on the list
      ... Check the headers for your unsubscription address For additional commands ... Also check the archives at http://lists.suse.com ...
      (SuSE)
    • Re: [SLE] Printer Que
      ... I don't always plug it in immediately. ... > Check the headers for your unsubscription address ... For additional commands send e-mail to suse-linux-e-help@suse.com ...
      (SuSE)
    • Re: [SLE] ftp install on an nforce2 mobo
      ... > Check the headers for your unsubscription address ... Do you Yahoo!? ... For additional commands send e-mail to suse-linux-e-help@suse.com ...
      (SuSE)
    • RE: [SLE] Please help me convert SMB mounts on boot up
      ... Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com ...
      (SuSE)
    • Re: [SLE] Linux on an ancient laptop - DEAD!
      ... > Check the headers for your unsubscription address ... For additional commands send e-mail to suse-linux-e-help@suse.com ...
      (SuSE)