Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 04, 2015, 07:28:44 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DONE: HashReplace - Replace all files with identical contents  (Read 4565 times)

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,896
    • View Profile
    • Donate to Member
What it does:
Replace all files in a folder with identical filename AND SHA1 hash as original.file with new.file.

Use Cases
Say I have updated the contents of a php file that is used multiple times throughout my project, and now I want all other copies of that file to be updated as well.
In most cases the following code would work:
Code: Text
  1. replace some_file.php c:\projects\example_project
  2.  
However if the file is readme.txt or config.php for example, then you'd have overwritten many wrong copies. Using HashReplace only files with the same name and same contents will be overwritten with the new contents.

Download
Source, Executable and Test files
« Last Edit: June 15, 2011, 07:47:08 AM by justice »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 35,012
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: DONE: HashReplace - Replace all files with identical contents
« Reply #1 on: June 15, 2011, 10:26:41 AM »
very nice idea!

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,896
    • View Profile
    • Donate to Member
Re: DONE: HashReplace - Replace all files with identical contents
« Reply #2 on: June 26, 2012, 07:16:08 AM »
If you want to play with the latest source, you can now fork from Bitbucket:
https://bitbucket.or...vandragt/hashreplace

I'll keep posting executable releases in this topic when they're available.