in reply to Re^5: Renaming an image file
in thread Renaming an image file

Until you want to delete one of them and keep the other. Unless you change your archival system so that it can deal with shared images, it'll be ill advised to silently have them point to the same physical structure.

Replies are listed 'Best First'.
Re^7: Renaming an image file
by Anonymous Monk on Nov 28, 2010 at 13:15 UTC
    fore sure, but if that is the case, why store it in the same directory? or why rename the file at all?
      I neither know, nor I care. But just because *I* wouldn't do it, or I cannot imagine why someone else does it, I'm not going to recommend a solution to a problem that may lead to lost data. I think it's very bad advice if on the question "how do I create unique filenames", one gives a solution that may lead to data loss.

        Correct me if I am wrong, but if you have filenames of the form user_nnnnn.jpg, and you rename them to the form user_md5.jpg, the only "loss of data" that could occur is if a user has uploaded the same file under two different names?

        Or the 1 in 34 undecillion (billion, billion, billion) chance that the same user uploaded two different files that hashed to the same md5.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.