From 379f6ac1c385a5b2ce4f9924a6eabb6984c1374e Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Thu, 20 Aug 2015 09:26:29 +0100 Subject: [PATCH] Return info on a file over FTP --- lib/ftp-control.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/ftp-control.php b/lib/ftp-control.php index 0c9e195..e46f96d 100644 --- a/lib/ftp-control.php +++ b/lib/ftp-control.php @@ -40,6 +40,19 @@ function ftpGetList($ftpConn, $directory = '.') { return false; } +// Get detailed info on a file from returned info from ftpGetList +function ftpGetFileInfo($ftpConn, $directory = '.', $fileName) { + // Get both sets of arrays back and get our detailed list + $ftpListArrays = ftpGetList($ftpConn, $directory); + $detailedList = $ftpListArrays['detailedList']; + + // Now get the file info for our file + $fileInfo = $detailedList[$fileName]; + + // Return the info + return $fileInfo; +} + // Get contents over FTP function ftpGetContents($ftpConn, $filepath, $ftpMode) { // Create temp handler, this type needed for extended char set