Welcome Guest, Not a member yet? Register   Sign In
small mistake about 'get_dir_file_info'

(This post was last modified: 06-22-2016, 09:37 AM by Bernard59.)

I do not know if the problem has already been informed, but just in case, let me point out what appears to be an error.
the "File_Helper" said about 'get_dir_file_info':

Quote:Reads the specified directory and builds an array Containing the filenames, filesize, dates, and permissions. Sub-folders contained dans le specified path are only read if forced by sending the second parameter to FALSE, as this can be an intensive operation.

So, this should give all the files in all sub-folders ....

But, as the result is an array whose first key is the name of the file ($file), if files with the same name ($file) are contained in several sub-folders, the final array will contain only that proceedings to file ($file): the last found by the script.

Therefore, if we want to use this script (get_dir_file_info) to resolve all files contained in a folder and subfolders, it is necessary to use a file name only once time, and/ or rename each file with indexing its name, for example by incrementing (file1.ext, file2.ext ...)

(This post was last modified: 06-22-2016, 09:47 AM by Bernard59.)

For example:
if 'test.txt' is contained in '\public' and his sub folder '\public\uploads', the result is only:
[Test.txt] => Array
[Name] => test.txt
[Server_path] => ......\public_\uploads\test.txt

and will not be counted twice (once in '\public' and two again in '\public\uploads')

It's not an error; it's a badly-designed legacy feature.

OK thank you for your answer

Theme © iAndrew 2016 - Forum software by © MyBB