FCNTL in perl

R

Roach4

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
 
R

Robin

Roach4 said:
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.
 
T

Tad McClellan

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.
 
R

Roach4

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
 
J

Jeff Stampes

Roach4 said:
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
 
T

Tassilo v. Parseval

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top