Hello,
I am looking for a way to get the TOTAL COUNT of the files present in all directories(sub directories) under the root directory..The files can be of any type viz. txt, doc, html, wav, jpeg etc. If it has an extension, it has to be counted..
I want to run the script from the root directory.... (6 Replies)
Hey,
I'm very new to AWK and am trying to write a script that counts the number of files in all subdirectories. So, basically, my root has many subdirectories, and each subdirectory has many files.
How can I get the total count? I haven't been able to figure out how to loop through the... (1 Reply)
Hi,
I have a requirement to find out the count of files in directories. I can do this very well by goind to each directory and then ls -lrt | wc -l. But I need to do it for hundreds of directories/sub-directories.
I tried with this -
for i in `ls -F | grep '/$'`; do `echo "$i"`| ls -lrt... (2 Replies)
Hi
I have a jfs2 filesystem named /software in my aix 5.3 box.
Please note that there are a lot of subdirectories under /software?
I need to know the count of how many total files and directories are present under that mount point /software ?
For example if by some commands we find that there... (3 Replies)
ok basically im trying to count how many people fail a class by comparing there grade by -gt 49
i tried putting a count inside the while loop but i know you cant access a count outside a subshell. is there an easy way to count the number of failures?
declare -i failcount=0
awk... (2 Replies)
im trying to write a script that will put files with different extensions into their specified directories
In the directory are files of various types, i want to arrange the files on individual directories under their type. There are three distinct types of files: 1) Text documents - files with... (2 Replies)
Hi All!
I would like to have a script that will count the number of files at the top of the hour of soome directories and mail the results to me.
I was thinking on :
a=`/directory/subdirectory/ | wc -l`
echo "/directory/subdirectory :$a"
b=`/another_dir/subdir/ | wc -l`
echo... (12 Replies)
I'm trying to make a script that will list all directories under a selection as well as the number of files in each.
I cannot get it to work under a symbolic link.
The file structure is:
XXX_20131127_001
dir01 (sym link)
2404x912
file.0000.xxx to
... (10 Replies)
Hi All,
Everyday we will receive 33 files in our source directory(/prd/pk) with the current date. Once our jobs are completed all the 33 files immediately will be moved to backup folder (/prd/pk/backup).
Now, I need to check between source file directory (/prd/pdk) and backup file directory... (3 Replies)
Discussion started by: suresh_target
3 Replies
LEARN ABOUT PHP
shm_attach
SHM_ATTACH(3) 1 SHM_ATTACH(3)shm_attach - Creates or open a shared memory segmentSYNOPSIS
resource shm_attach (int $key, [int $memsize], [int $perm = 0666])
DESCRIPTION shm_attach(3) returns an id that can be used to access the System V shared memory with the given $key, the first call creates the shared
memory segment with $memsize and the optional perm-bits $perm.
A second call to shm_attach(3) for the same $key will return a different shared memory identifier, but both identifiers access the same
underlying shared memory. $memsize and $perm will be ignored.
PARAMETERS
o $key
- A numeric shared memory segment ID
o $memsize
- The memory size. If not provided, default to the sysvshm.init_mem in the php.ini, otherwise 10000 bytes.
o $perm
- The optional permission bits. Default to 0666.
RETURN VALUES
Returns a shared memory segment identifier.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.0 | |
| | |
| | This function now returns a resource instead of |
| | an integer. |
| | |
+--------+---------------------------------------------------+
NOTES
Note
This function used to return an integer value prior to PHP 5.3.0. To achieve the same value in a portable manner, the return value
can be cast to an integer like:
Example #1
<?php
// Create a temporary file and return its path
$tmp = tempnam('/tmp', 'PHP');
// Get the file token key
$key = ftok($tmp, 'a');
// Attach the SHM resource, notice the cast afterwards
$id = shm_attach($key);
if ($id === false) {
die('Unable to create the shared memory segment');
}
// Cast to integer, since prior to PHP 5.3.0 the resource id
// is returned which can be exposed when casting a resource
// to an integer
$id = (integer) $id;
?>
SEE ALSO shm_detach(3), ftok(3).
PHP Documentation Group SHM_ATTACH(3)