FCNTL in perl

Discussion in 'Perl Misc' started by Roach4, Mar 9, 2005.

  1. Roach4

    Roach4 Guest

    Hi,

    I'm new to perl and I've to monitor a DIRECTORY for changes in it
    using the FCNTL module in perl.

    Anyone could give me a hand by posting examples or hints on how I
    could be able to do that?


    Thank you very much,

    David
    Roach4, Mar 9, 2005
    #1
    1. Advertising

  2. Roach4

    Robin Guest

    "Roach4" <> wrote in message
    news:...
    > Hi,
    >
    > I'm new to perl and I've to monitor a DIRECTORY for changes in it
    > using the FCNTL module in perl.
    >
    > Anyone could give me a hand by posting examples or hints on how I
    > could be able to do that?
    >
    >
    > Thank you very much,
    >
    > David


    please try something simpler like running a chdir ("$yourdir"); command,
    forget those double quotes though.
    Robin, Mar 10, 2005
    #2
    1. Advertising

  3. Robin <> wrote:
    > "Roach4" <> wrote in message
    > news:...


    >> I'm new to perl and I've to monitor a DIRECTORY for changes in it


    > please try something simpler like running a chdir ("$yourdir"); command,
    > forget those double quotes though.



    Please consider doing something besides posting to Usenet
    when you are drunk.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Mar 10, 2005
    #3
  4. Roach4

    Roach4 Guest

    Hi again,


    I asked help about FCNTL because I don't have the choice of what I
    want to use to monitor.

    So anyone could give me a hand with it??

    Thanks,

    David




    "Robin" <webmaster @ infusedlight.net> wrote in message news:<>...
    > "Roach4" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > I'm new to perl and I've to monitor a DIRECTORY for changes in it
    > > using the FCNTL module in perl.
    > >
    > > Anyone could give me a hand by posting examples or hints on how I
    > > could be able to do that?
    > >
    > >
    > > Thank you very much,
    > >
    > > David

    >
    > please try something simpler like running a chdir ("$yourdir"); command,
    > forget those double quotes though.
    Roach4, Mar 10, 2005
    #4
  5. Roach4

    Jeff Stampes Guest

    Roach4 wrote:
    > I asked help about FCNTL because I don't have the choice of what I
    > want to use to monitor.
    >
    > So anyone could give me a hand with it??


    Why the Chinese character encoding?

    You've read 'perldoc -f fcntl'?

    You've read 'perldoc Fcntl'?

    You've read 'man fcntl' on your system?

    What do you specifically have questions with?

    What have you tried and how did it fail?

    ~Jeff
    "He looked at me and said,
    'How exactly is it I can help you sir?'
    I just bought some nails,
    and got the Hell out of there" - Tim O'Brien
    Jeff Stampes, Mar 10, 2005
    #5
  6. Also sprach Roach4:

    > I'm new to perl and I've to monitor a DIRECTORY for changes in it
    > using the FCNTL module in perl.
    >
    > Anyone could give me a hand by posting examples or hints on how I
    > could be able to do that?


    That's not much different from how you'd do it in C:

    use Fcntl qw/F_NOTIFY DN_CREATE DN_ACCESS/;

    $SIG{IO} = sub { print "creation or access happened\n"; };

    open DIR, "/tmp/." or die $!;
    fcntl DIR, F_NOTIFY, DN_CREATE|DN_ACCESS or die $!;

    # /tmp is now being watched for DN_CREATE and DN_ACCESS

    Tassilo
    --
    use bigint;
    $n=71423350343770280161397026330337371139054411854220053437565440;
    $m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);
    Tassilo v. Parseval, Mar 10, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wicur

    Fcntl problem

    wicur, Feb 2, 2004, in forum: Perl
    Replies:
    0
    Views:
    503
    wicur
    Feb 2, 2004
  2. =?ISO-8859-1?Q?J=FCrgen_Voss?=

    locking with fcntl

    =?ISO-8859-1?Q?J=FCrgen_Voss?=, Apr 21, 2004, in forum: C Programming
    Replies:
    1
    Views:
    266
    Joona I Palaste
    Apr 21, 2004
  3. Omid Fatemi

    fcntl and FCNTL

    Omid Fatemi, Oct 30, 2004, in forum: Python
    Replies:
    4
    Views:
    6,817
    Steve Holden
    Nov 1, 2004
  4. Mitko Haralanov

    Invalid argument with fcntl.fcntl

    Mitko Haralanov, Jun 6, 2007, in forum: Python
    Replies:
    0
    Views:
    531
    Mitko Haralanov
    Jun 6, 2007
  5. Brian R.
    Replies:
    0
    Views:
    117
    Brian R.
    Jun 14, 2004
Loading...

Share This Page