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

Oh my! Do you really credit me with prescient foresight that I can instantly foresee every possible scenario that the OP might encounter?
So, what is it? Did you make unstated assumptions, or did you not realize the scenario that morgon described? You can have either, but not both.

Replies are listed 'Best First'.
Re^17: Renaming an image file
by BrowserUk (Patriarch) on Nov 29, 2010 at 19:25 UTC
    So, what is it?

    When I made the original suggestion, I was aware that in some scenarios the potential to eliminate duplicate files was beneficial; and that in others it could be compensated for by the necessary re-mapping of links to files.

    I was also aware that in some scenarios, eliminating the user name entirely might lead to even greater disk-space savings, provided the link re-mapping mechanism was sufficiently robust to compensate.

    I was also aware that there could be some scenarios where hashing the contents alone would be insufficient.

    But mostly, I was aware that it was impossible for me to consider all possible scenarios.

    And that it would be stupid to think I could possibly describe and address all those possibilities; detail all the assumptions that would be need to be considered in each of them; and cover off every one of them with either a full guarentee or an iron-clad disclaimer.

    So, as is the norm with forums such as this, I didn't attempt to do any of that. Just as no one else here does!

    OPs ask questions; some monks(*) offer solutions. The OP takes--or not--from those offered suggestions what best fits their--usually, most undescribed--situations.

    Are you suggesting that I should given cast-iron guarantees with my suggestions?

    (*)Of course, then there are the other monks who don't offer solutions, but just ...


    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.
      Are you suggesting that I should given cast-iron guarantees with my suggestions?
      No. Did I ever say that? But, if you knew all this when writing your original reply:
      When I made the original suggestion, I was aware that in some scenarios the potential to eliminate duplicate files was beneficial; and that in others it could be compensated for by the necessary re-mapping of links to files.

      I was also aware that in some scenarios, eliminating the user name entirely might lead to even greater disk-space savings, provided the link re-mapping mechanism was sufficiently robust to compensate.

      I was also aware that there could be some scenarios where hashing the contents alone would be insufficient.

      The why keep you all that for yourself, and didn't mention it? That's a lot more than the average perlmonk would consider. If you indeed did realize that duplicate files hash to the same filename, why didn't you say so? Instead, you say that the chance of collisions is remote.
        If you indeed did realize that duplicate files hash to the same filename, why didn't you say so?

        Because it is so obvious that it didn't even cross my mind to consider it worth mentioning.

        Of course duplicate files hash to the same value. How could they not. (That's a rhetorical question!)

        Instead, you say that the chance of collisions is remote.

        Duplicate files hashing to the same value is neither surprising, nor "a collision". Not by any meaning of the term, no matter how contrived.

        I don't treat OPs as idiots by explicitly stating such obvious truths.

        Just as nobody--when they offer a line-by-line solution--explicitly states that if a large file contains no newlines; or a single line that is larger than memory; that the solution will fail.

        Are we done with the meta discussion now?


        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.