monkeytooth Posted August 13, 2011 Share Posted August 13, 2011 What would be the best way to compare files and or directories. Lets say I want to store files on a sever or collective of servers like a cloud based system. My users are in collaboration with one another in many cases and some not. Either way I can have upwards of a hundred people or more with the same exact file. Only key difference is they likey renamed the file or whatever. But essentially same exact data all around. Now other thing is there is no specific file type. There's pdf, doc, docx, txt, videos, audio files, etc.. but the issue boils down to the same files over and over. What i want to do is cut it down. Remove the hundreds of dupes and with the help of a database store things like the file name the user provided so I can in turn store the single file left how and where I want while still providing the info they used essentially. Now i know I can do something with md5 or sha1 or sha2 or something equivalent that will essentially give me a unique value I can use for such comparisons. But i am not exactly sure how or where to begin with that. Such as how with php can I get the sha or md5 of a file? When i look up stuff for those I get methods for strings but not files.. Overall I am here looking to bounce ideas around to figuring this out not so much as a direct means.. any help would be great. Quote Link to comment https://forums.phpfreaks.com/topic/244660-what-would-be-the-best-way-to-approach-files-and-directories/ Share on other sites More sharing options...
trq Posted August 13, 2011 Share Posted August 13, 2011 Sounds to me like your looking for a VCS. Git is a good example. Quote Link to comment https://forums.phpfreaks.com/topic/244660-what-would-be-the-best-way-to-approach-files-and-directories/#findComment-1256696 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.