i have done some testing on both and it appears that scandir is better to use for what i need.
As i dont need to open any files i just need to see whats in the the dir and i like that scandir puts the files already in alpha order and it also does not include the dir name prefix in the print_r, it just has the array of file names which saves me time.
Here is what im doing, in my table i have a list of dir file names. What i want to do is compare the name of the file in the table with the name of the file in the dir.
If the file name exists in the dir but not in the table, i want to run a report list of files not included in the table. (this way i can make sure that what i have not included in the table is accurate)
If it exists in the table but not in the dir then i need a report that tells me that. (it prob means i deleted a file from the dir and forgot to remove it from the table)
This whole thing is designed to make sure that dir and table match perfectly unless i choose to not include in the table for good reason.
i know i will have to pick out . and .. and also mark sub dir folders in the process but.
Question is. Is scandir what i want to use?
As i dont need to open any files i just need to see whats in the the dir and i like that scandir puts the files already in alpha order and it also does not include the dir name prefix in the print_r, it just has the array of file names which saves me time.
Here is what im doing, in my table i have a list of dir file names. What i want to do is compare the name of the file in the table with the name of the file in the dir.
If the file name exists in the dir but not in the table, i want to run a report list of files not included in the table. (this way i can make sure that what i have not included in the table is accurate)
If it exists in the table but not in the dir then i need a report that tells me that. (it prob means i deleted a file from the dir and forgot to remove it from the table)
This whole thing is designed to make sure that dir and table match perfectly unless i choose to not include in the table for good reason.
i know i will have to pick out . and .. and also mark sub dir folders in the process but.
Question is. Is scandir what i want to use?
Comment