dreamwest Posted April 26, 2009 Share Posted April 26, 2009 I have over 30,000 videos in one directory. I certainly cant use an ftp client to open the directory, so i cant tell if there are any hacker files in there. What is the safe amount of file to load into one directory? Does it slow down the server if it has to scan the entire directory to find the one file? Quote Link to comment https://forums.phpfreaks.com/topic/155692-how-many-file-in-a-directory/ Share on other sites More sharing options...
Mchl Posted April 26, 2009 Share Posted April 26, 2009 Depends on file system used. For example FAT16 had a limit on 1024 files/subdirectories IIRC. Most modern file systems do not have any limits on that as far as I know, but as you have noticed by yourself, having very large amount of files in one directory can become unwieldy. Quote Link to comment https://forums.phpfreaks.com/topic/155692-how-many-file-in-a-directory/#findComment-819522 Share on other sites More sharing options...
Daniel0 Posted April 26, 2009 Share Posted April 26, 2009 Does it slow down the server if it has to scan the entire directory to find the one file? Well, yeah, if you're doing a linear search then it will obviously potentially take longer time finding what you're looking for with a larger problem size. How are you doing the search? Quote Link to comment https://forums.phpfreaks.com/topic/155692-how-many-file-in-a-directory/#findComment-819530 Share on other sites More sharing options...
.josh Posted April 26, 2009 Share Posted April 26, 2009 I'm curious how you would eyeball whether the files are "hacker" files or not... plan on just looking at the filenames and seeing if there are files in there that don't match a specific naming convention? Would be way faster to just write a quick program for that... but that really only weeds out "hacker" files that are foolish enough to not follow naming conventions... Quote Link to comment https://forums.phpfreaks.com/topic/155692-how-many-file-in-a-directory/#findComment-819704 Share on other sites More sharing options...
Daniel0 Posted April 26, 2009 Share Posted April 26, 2009 He would probably check the mime type or something like that. Quote Link to comment https://forums.phpfreaks.com/topic/155692-how-many-file-in-a-directory/#findComment-819708 Share on other sites More sharing options...
dreamwest Posted April 26, 2009 Author Share Posted April 26, 2009 Does it slow down the server if it has to scan the entire directory to find the one file? Well, yeah, if you're doing a linear search then it will obviously potentially take longer time finding what you're looking for with a larger problem size. How are you doing the search? Search is query driven. Pulls the file name from the database then gets the file based on the name Quote Link to comment https://forums.phpfreaks.com/topic/155692-how-many-file-in-a-directory/#findComment-819791 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.