Use the following to Change permission of fileB (fileB could be fileB*) to change its permission same as the permission of fileA.
chmod `ls -l fileA | awk '{pr
int "u+", substr($1,2,1), substr($1,3,1), substr($1,4,1), ",g+", substr($1,5,1),
substr($1,6,1), substr($1,7,1), ",o+",... (0 Replies)
Is it possible to change the permissons
for an entire directory in one shot?
I'm telneting on to a linux server.
...just a beginner--
--Paul (4 Replies)
So I need to change the permissions of my user account. I can
access the root account on the server, but don't know how to
change the permissions of my user account. I was advised to
try 'userconf' to see if I am part of a group, but I dunno how that works. ANyone who knows how to see the... (3 Replies)
Hi,
I'm trying to execute a shell script from application (Informatica). The script works fine when I execute it from command line but fails when executed from Informatica. The tricky part is that there is other scripts in the same folder that can be executed succesfully from both command line... (1 Reply)
Hi,
I am using HP-UNIX.
I have a requirement as below
I have to change env twice like:
cadenv <env>
cadenv <env>
ccm start -d /dbpath
ccm tar -xvf *.tar
ccm rcv ....
mv *.tar BACKUP
but after I do the first cadenv <env> , I am unable to execute any of the later commands .
... (6 Replies)
does anyone know how to write a script that will change file permissions. because the Admin blocked me from altering any of my files im only allowed to read and i heard a script like this can bypass it but i dont know how to write it.
Display current users. Display user Ids only.
Display... (10 Replies)
I have the following command. This is meant to download all files from my server to the Downloads folder of my startup drive:
/usr/local/bin/rsync -avve ssh --numeric-ids --delete --ignore-errors -R grndlvl@myserver.com:/usr/home/./grndlvl grndlvl@myserver.com:/usr/home/./grndlvl/mail_boxes/... (8 Replies)
HI,
I wann give permissions to a folder which contains multiple folders.....
how can i give permissions to all folder at a time
tat means if i give permissions to main folder it
the same permissions has to take on all the folders in the main folders
how can i use one command to give... (1 Reply)
Hi, Im getting this annoying problem on file permission when I copy a folder to a mounted external directory. the files inside the copied folders become all executable. I tried to search for ways how to undo the permission over the web but to no avail.
tried this one but it doesnt change a... (2 Replies)
Discussion started by: ida1215
2 Replies
LEARN ABOUT PHP
stat
STAT(3) 1 STAT(3)stat - Gives information about a fileSYNOPSIS
array stat (string $filename)
DESCRIPTION
Gathers the statistics of the file named by $filename. If $filename is a symbolic link, statistics are from the file itself, not the sym-
link.
lstat(3) is identical to stat(3) except it would instead be based off the symlinks status.
PARAMETERS
o $filename
- Path to the file.
RETURN VALUES stat(3) and fstat(3) result format
+--------+--------------------------------------+---+
|Numeric | | |
| | | |
| | Associative | |
| | | |
| | Description | |
| | | |
+--------+--------------------------------------+---+
| 0 | | |
| | | |
| | dev | |
| | | |
| | device number | |
| | | |
| 1 | | |
| | | |
| | ino | |
| | | |
| | inode number * | |
| | | |
| 2 | | |
| | | |
| | mode | |
| | | |
| | inode protection mode | |
| | | |
| 3 | | |
| | | |
| | nlink | |
| | | |
| | number of links | |
| | | |
| 4 | | |
| | | |
| | uid | |
| | | |
| | userid of owner * | |
| | | |
| 5 | | |
| | | |
| | gid | |
| | | |
| | groupid of owner * | |
| | | |
| 6 | | |
| | | |
| | rdev | |
| | | |
| | device type, if inode device | |
| | | |
| 7 | | |
| | | |
| | size | |
| | | |
| | size in bytes | |
| | | |
| 8 | | |
| | | |
| | atime | |
| | | |
| | time of last access (Unix timestamp) | |
| | | |
| 9 | | |
| | | |
| | mtime | |
| | | |
| | time of last modification (Unix | |
| | timestamp) | |
| | | |
| 10 | | |
| | | |
| | ctime | |
| | | |
| | time of last inode change (Unix | |
| | timestamp) | |
| | | |
| 11 | | |
| | | |
| | blksize | |
| | | |
| | blocksize of filesystem IO ** | |
| | | |
| 12 | | |
| | | |
| | blocks | |
| | | |
| | number of 512-byte blocks allocated | |
| | ** | |
| | | |
+--------+--------------------------------------+---+
* On Windows this will always be 0.
** Only valid on systems supporting the st_blksize type - other systems (e.g. Windows) return -1.
In case of error, stat(3) returns FALSE.
Note
Because PHP's integer type is signed and many platforms use 32bit integers, some filesystem functions may return unexpected results
for files which are larger than 2GB.
ERRORS /EXCEPTIONS
Upon failure, an E_WARNING is emitted.
EXAMPLES
Example #1
stat(3) example
<?php
/* Get file stat */
$stat = stat('C:phpphp.exe');
/*
* Print file access time, this is the same
* as calling fileatime()
*/
echo 'Access time: ' . $stat['atime'];
/*
* Print file modification time, this is the
* same as calling filemtime()
*/
echo 'Modification time: ' . $stat['mtime'];
/* Print the device number */
echo 'Device number: ' . $stat['dev'];
?>
Example #2
Using stat(3) information together with touch(3)
<?php
/* Get file stat */
$stat = stat('C:phpphp.exe');
/* Did we failed to get stat information? */
if (!$stat) {
echo 'stat() call failed...';
} else {
/*
* We want the access time to be 1 week
* after the current access time.
*/
$atime = $stat['atime'] + 604800;
/* Touch the file */
if (!touch('some_file.txt', time(), $atime)) {
echo 'Failed to touch file...';
} else {
echo 'touch() returned success...';
}
}
?>
NOTES
Note
Note that time resolution may differ from one file system to another.
Note
The results of this function are cached. See clearstatcache(3) for more details.
Tip
As of PHP 5.0.0, this function can also be used with some URL wrappers. Refer to "Supported Protocols and Wrappers" to determine
which wrappers support stat(3) family of functionality.
SEE ALSO lstat(3), fstat(3), filemtime(3), filegroup(3).
PHP Documentation Group STAT(3)