Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lstat(3) [php man page]

LSTAT(3)								 1								  LSTAT(3)

lstat - Gives information about a file or symbolic link

SYNOPSIS
array lstat (string $filename) DESCRIPTION
Gathers the statistics of the file or symbolic link named by $filename. PARAMETERS
o $filename - Path to a file or a symbolic link. RETURN VALUES
See the manual page for stat(3) for information on the structure of the array that lstat(3) returns. This function is identical to the stat(3) function except that if the $filename parameter is a symbolic link, the status of the symbolic link is returned, not the status of the file pointed to by the symbolic link. EXAMPLES
Example #1 Comparison of stat(3) and lstat(3) <?php symlink('uploads.php', 'uploads'); // Contrast information for uploads.php and uploads array_diff(stat('uploads'), lstat('uploads')); ?> The above example will output something similar to: Information that differs between the two files. Array ( [ino] => 97236376 [mode] => 33188 [size] => 34 [atime] => 1223580003 [mtime] => 1223581848 [ctime] => 1223581848 [blocks] => 8 ) ERRORS
/EXCEPTIONS Upon failure, an E_WARNING is emitted. NOTES
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
stat(3). PHP Documentation Group LSTAT(3)

Check Out this Related Man Page

SSH2_SFTP_LSTAT(3)							 1							SSH2_SFTP_LSTAT(3)

ssh2_sftp_lstat - Stat a symbolic link

SYNOPSIS
array ssh2_sftp_lstat (resource $sftp, string $path) DESCRIPTION
Stats a symbolic link on the remote filesystem without following the link. This function is similar to using the lstat(3) function with the ssh2.sftp:// wrapper in PHP 5 and returns the same values. PARAMETERS
o $sftp - o $path - Path to the remote symbolic link. RETURN VALUES
See the documentation for stat(3) for details on the values which may be returned. EXAMPLES
Example #1 Stating a symbolic link via SFTP <?php $connection = ssh2_connect('shell.example.com', 22); ssh2_auth_password($connection, 'username', 'password'); $sftp = ssh2_sftp($connection); $statinfo = ssh2_sftp_lstat($sftp, '/path/to/symlink'); $filesize = $statinfo['size']; $group = $statinfo['gid']; $owner = $statinfo['uid']; $atime = $statinfo['atime']; $mtime = $statinfo['mtime']; $mode = $statinfo['mode']; ?> SEE ALSO
ssh2_sftp_stat(3), lstat(3), stat(3). PHP Documentation Group SSH2_SFTP_LSTAT(3)
Man Page

14 More Discussions You Might Find Interesting

1. Programming

stat() fails!!! what can i do?

Hi all, I can not understand why my stat() function fails all the time when function tries to go recursevly. Someone suggested that it might be poiter problem. Please, look up my code at: www.donnelly.cc.ks.us/readdir_test.c. How can i solve this problem? Any suggestion are welcome! Thank you... (3 Replies)
Discussion started by: solvman
3 Replies

2. Shell Programming and Scripting

perl: why the return valure of stat and lstat are the same?

i tried to use stat to get the attributes of a file and a soft link. but the result i got from stat and lstat are the same. say: ln -s f1 soft1 (soft is a soft link , point to f1) if i use > ls -il shows the inode and modify time of soft1 and f1 are different. but the modify... (1 Reply)
Discussion started by: gusla
1 Replies

3. Shell Programming and Scripting

stat command

how can ý use "stat command"????.. (2 Replies)
Discussion started by: emreatlier
2 Replies

4. UNIX for Dummies Questions & Answers

How to find time

Help me with this please... If i am entering command ls -l, here is what it gives: -rw-r----- 1 user22 psa 2140 Dec 2 2005 summary.gz anyone knows how can i know the time it was last modified? (7 Replies)
Discussion started by: dakid
7 Replies

5. Shell Programming and Scripting

monitor daily file uploads

hey all, i am a shell scripting n00b so bear with me. i got a server that every night uploads one file to a remote server. the file is prodserver_date_time. i would like to make a script, run by root on a daily cron job. i want it to determine if the file was received or not. no md5... (2 Replies)
Discussion started by: jweinraub
2 Replies

6. IP Networking

QOS script

Does anyone know how can I determine which user is UPLOADING via http protocol? Like sending video on youtube? Or maybe how to throttle multimedia uploads ? Or any uploads? maybe get packet size? (9 Replies)
Discussion started by: darkman_hr
9 Replies

7. Programming

lstat problem

Hello, I have a little problem with lstat. I use the find utility, to find a path for a file in my system. After that,I take that path and I pass it in lstat, but lstat returns -1, and this error : no such file or directory. So I m trying to "ls" the path in the shell, but it also fails. ... (1 Reply)
Discussion started by: garag11
1 Replies

8. UNIX for Dummies Questions & Answers

lstat problem

Hello, I have a little problem with lstat. I use the find utility, to find a path for a file in my system. After that,I take that path and I pass it in lstat, but lstat returns -1, and this error : no such file or directory. So I m trying to "ls" the path in the shell, but it also fails. ... (2 Replies)
Discussion started by: garag11
2 Replies

9. UNIX for Dummies Questions & Answers

stat output

hi guys i got confused about stat output stat manual says File : Size in Bytes Blocks : Number of blocks used IO Block : Size in bytes of every block. when i use stat command for passwd file it says ~#stat /etc/passwd File: `/etc/passwd' Size: 999 Blocks: 8 IO... (4 Replies)
Discussion started by: mhs
4 Replies

10. Shell Programming and Scripting

Average of a column in multiple files

I have several sequential files with name stat.1000, stat.1001....to stat.1020 with a format like this 0.01 1 3822 4.97379915032e-14 4.96982253992e-09 0 0.01 3822 1 4.97379915032e-14 4.96982253992e-09 0 0.01 2 502 0.00993165137406 993.165137406 0 0.01 502 2 0.00993165137406 993.165137406 0... (6 Replies)
Discussion started by: kayak
6 Replies

11. Shell Programming and Scripting

Joining multiple files tail on tail

I have 250 files that have 16 columns each - all numbered as follows stat.1000, stat.1001, stat.1002, stat.1003....stat.1250. I would like to join all 250 of them together tail by tail as follows. For example stat.1000 a b c d e f stat.1001 g h i j k l So that my output... (2 Replies)
Discussion started by: kayak
2 Replies

12. UNIX for Dummies Questions & Answers

Why du and stat are showing different mtime?

$ stat qt_tdata_025/dblogs File: `qt_tdata_025/dblogs' Size: 4096 Blocks: 8 IO Block: 4096 directory Device: 1ch/28d Inode: 2017 Links: 15 Access: (0775/drwxrwxr-x) Uid: (31659/ prod) Gid: ( 4843/ycef) Access: 2013-04-08 12:49:44.102212000 -0400 Modify:... (1 Reply)
Discussion started by: urello
1 Replies

13. UNIX for Dummies Questions & Answers

Effective Commands To Get Time/Size in Bash

Hello All, Is there an effective approach in Bash to get size of the file and time stamp(including year) on the file. I have below please comment. SIZE=`/usr/bin/du -sh "${LOCATION}"/"${DATAFILE}" | awk '{print $1}'` BSIZE=`/usr/bin/du -b "${LOCATION}"/"${DATAFILE}" | awk... (10 Replies)
Discussion started by: Ariean
10 Replies

14. Shell Programming and Scripting

Get the filename linked to symbolic link

Hello guys, I have a simple problem. Do you know any way to get the get the filename linked to symbolic link? I think use "ls -l <myfile> | cut -d '>' -f2", but i know it is a bad practice take information from the output of "ls -l". I dont have "stat" comand neither. :( Regards! ... (6 Replies)
Discussion started by: Xedrox
6 Replies