du (sum up the data blocks) takes longer than ls (calls stat() once)
The following does two stat():
Hello,
May i know what do you mean "Calls stat once"?
when i did "man stat" it says display file or file system status.
But didn't understand how ls calls stat() once.
Hi,
I have one file stat.
Stat file contents are as follows: for example.
H50768020040913,00260100,507680,13,0000000643,0000000643,00000,0000
H50769520040808,00260100,507695,13,0000000000,0000000000,00000,0000 H50770620040611,00260100,507706,13,0000000000,0000000000,00000,0000
Now i... (1 Reply)
Hello guys, I am new at shell scripting and I want to create a script that runs several commands at a time, ie: uptime, w, df -h and so on and send the output of this commands to a text file so it can be send via email at a certain time using crontab.
Any help will be much appreciated! (4 Replies)
I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config.
I am not sure if I can do this with BASH scripting.
I have set up password less login by adding my public key to authorized_keys file, it works.
I am a little... (1 Reply)
Hi @all
I have got the following problem:
I want my Master-Script to execute 2 Sub-scripts at the same time.
How can i realize that?
Thx for your help
Greez Roger (2 Replies)
How do you combine these ls commands so that I can have the outputs by name, time stamp, and size?
ls -al |grep name_of_file
ls -al | sort +4nr
ls -l -t
Please advise. (4 Replies)
Hi,
Commands ps -A include four parameters are PID, TTY, TIME and CMD. I can not found pathnames of TTY and TIME which I can read from file in C language to get information display on screen. Thank you!
Ex:
PID TTY TIME CMD
1 ? 00:00:01 init (2 Replies)
Hello guys,
Please i need to know the biggest files in my directory let's say$
>du -h | egrep 'M|G|G'
195M ./TMP
3.6M ./TP_DEC2012
146G .
But here the result it's giving me the biggest directory in the path.
Actually i want to know the biggest file in 146G .
Can anyone... (6 Replies)
How to run several bash commands put in bash command line without needing and requiring a script file.
Because I'm actually a windows guy and new here so for illustration is sort of :
$ bash "echo ${PATH} & echo have a nice day!"
will do output, for example:... (4 Replies)
I have a script that checks if the script has been ran with sudo.
If the script is not ran as sudo, the current script is being executed with exec sudo bash.
You are asked for a password, you type in the password, success. Everything is perfect - the commands inside the script are ran as sudo.... (1 Reply)
Discussion started by: boqsc
1 Replies
LEARN ABOUT DEBIAN
io::async::file
IO::Async::File(3pm) User Contributed Perl Documentation IO::Async::File(3pm)NAME
"IO::Async::File" - watch a file for changes
SYNOPSIS
use IO::Async::File;
use IO::Async::Loop;
my $loop = IO::Async::Loop->new;
my $file = IO::Async::File->new(
filename => "config.ini",
on_mtime_changed => sub {
my ( $self ) = @_;
print STDERR "Config file has changed
";
reload_config( $self->handle );
}
);
$loop->add( $file );
$loop->run;
DESCRIPTION
This subclass of IO::Async::Notifier watches an open filehandle or named filesystem entity for changes in its "stat()" fields. It invokes
various events when the values of these fields change. It is most often used to watch a file for size changes; for this task see also
IO::Async::FileStream.
While called "File", it is not required that the watched filehandle be a regular file. It is possible to watch anything that stat(2) may be
called on, such as directories or other filesystem entities.
EVENTS
The following events are invoked, either using subclass methods or CODE references in parameters.
on_dev_changed $new_dev, $old_dev
on_ino_changed $new_ino, $old_ino
...
on_ctime_changed $new_ctime, $old_ctime
Invoked when each of the individual "stat()" fields have changed. All the "stat()" fields are supported apart from "blocks" and "blksize".
Each is passed the new and old values of the field.
on_devino_changed $new_stat, $old_stat
Invoked when either of the "dev" or "ino" fields have changed. It is passed two File::stat instances containing the complete old and new
"stat()" fields. This can be used to observe when a named file is renamed; it will not be observed to happen on opened filehandles.
on_stat_changed $new_stat, $old_stat
Invoked when any of the "stat()" fields have changed. It is passed two File::stat instances containing the old and new "stat()" fields.
PARAMETERS
The following named parameters may be passed to "new" or "configure".
handle => IO
The opened filehandle to watch for "stat()" changes if "filename" is not supplied.
filename => STRING
Optional. If supplied, watches the named file rather than the filehandle given in "handle". The file will be opened for reading and
then watched for renames. If the file is renamed, the new filename is opened and tracked similarly after closing the previous file.
interval => NUM
Optional. The interval in seconds to poll the filehandle using stat(2) looking for size changes. A default of 2 seconds will be
applied if not defined.
METHODS
$handle = $file->handle
Returns the filehandle currently associated with the instance; either the one passed to the "handle" parameter, or opened from the
"filename" parameter.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
perl v5.14.2 2012-10-24 IO::Async::File(3pm)