دالة PHP lstat()
التعريف والاستخدام
يعود الدالة lstat() بمعلومات حول الملف أو الرابط المميز.
النحو
lstat(file)
معاملات | وصف |
---|---|
file | مطلوب. يحدد الملف الذي يجب فحصه. |
شرح
الحصول على file معلومات الإحصاء الخاصة بالملف أو الرابط المميز المحدد بالمعاملات.
تنسيق العودة من lstat()
مؤشر رقمي | اسم المفتاح المرتبط (من PHP 4.0.6) | شرح |
---|---|---|
0 | dev | اسم الجهاز |
1 | ino | رقم |
2 | mode | نمط حماية inode |
3 | nlink | عدد الروابط |
4 | uid | معرف مستخدم المالك |
5 | gid | معرف مجموعة المالك |
6 | rdev | نوع الجهاز، إذا كان جهازًا node |
7 | size | عدد الأحرف لحجم الملف |
8 | atime | الساعة الماضية لزيارة الوقت (توقيت Unix) |
9 | mtime | الساعة الماضية لتغيير الوقت (توقيت Unix) |
10 | ctime | الساعة الماضية لتغيير الوقت (توقيت Unix) |
11 | blksize | Block size of file system IO |
12 | blocks | Number of blocks occupied |
Tips and Comments
Tip:This function is similar to stat() The function is the same, the only difference is that if file If the 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.
Note:The result of this function will be cached. Please use clearstatcache() to clear the cache.
Example
<?php print_r(lstat("test.txt")); ?>
Output similar to:
Array ( [0] => 0 [1] => 0 [2] => 33206 [3] => 1 [4] => 0 [5] => 0 [6] => 0 [7] => 92 [8] => 1141633430 [9] => 1141298003 [10] => 1138609592 [11] => -1 [12] => -1 [dev] => 0 [ino] => 0 [mode] => 33206 [nlink] => 1 [uid] => 0 [gid] => 0 [rdev] => 0 [size] => 92 [atime] => 1141633430 [mtime] => 1141298003 [ctime] => 1138609592 [blksize] => -1 [blocks] => -1 )