Re: Getting a "unique identifier" for a file
| From: | SamuelDr | Date: | Tue, 31 Jan 2006 22:56:23 +0000 |
| Subject: | Re: Getting a "unique identifier" for a file | ||
| References: | 1 2 3 4 5 6 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-26671@lists.php.net to get a copy of this message | ||
Christoph Kunze a écrit :
SamuelDr schrieb:OK, thanks for this, it helps to know where not to look :PSamuelDr a écrit :I can think of that would get you a unique ID for a file that doesSamuelDr a écrit :Hi back, Manuel Lemos wrote :I have received this in my mail inbox... I saw that it was not there :Hello, on 01/28/2006 08:31 PM SamuelDr said the following:No, actually, I do not want to create a new file, I want to associate a certain file to a certain row in a DB. I want to do some windows desktop like web application for active desktop, and want to know if there could be some sort of way to have a unique identifier to each file. I would want this because, take this example in account : I have dowloaded a file, movie1.avi . I delete it. 2 hours later (the wipe in the DB for old file entries is not done) I download another file with the same name. It would be place at the place of the old one ! Maybe by checking the creation date, and the filename, that would be possibkle... only quirks : if you rename the file not from the web interface... it would place itself like a new icon.Hi ! I'm trying to develop something in PHP. I have a list of file, and I want to know if I can have a unique identifier for each files. What I mean, is: I have my files:tempnam ?test.txt test2.txtI would like them to return a unique something... anything...rely on the name being unique... 1) filename + creation date 2) filename + md5 hash of the contentsnotI think creation date will not work. If I create a file called "test.txt" on my desktop, then delete it and then create another file "test.txt" or rename an existing file to "test.txt", this file will get the creation date of the firstly created file.the first would be possible... I think. But the second, if someone modify its files, they would get back to their default position. Thanks anyway !I have received this in my inbox :SamualDr, You could get an MD5 hash of the file. It is extremely difficult for two different files to have the same hash. PaulIt would be a good idea if my files were not meant to be modyfied, but it seems that files on the desktop WILL be modified... So, i'm still looking for something.