Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
gary oldmans diary
Sep 26, 2005
Would someone take another crack at this? It works and I actually use it all the time, but it crashes a lot now.

Also if file size and CRC-32 are the same is a 3rd check really necessary in normal circumstances?

Hogburto posted:

Is making a duplicate file finder a little too large in scope for this thread?
Others exist and work, but the best one I can find gets an md5 from every single file under a directory instead of only getting the md5 of files that have matching file sizes in the first place. It takes an unnecessarily loooong time. Ironically, it has an option to ignore files with sizes below X.

Hoborg posted:

Enjoy.

http://bit.ly/MPeA6V

Sorry I beat you to it, ToxicFrog.

This program gathers all files then groups them by their size in bytes, then it computes the CRC-32 of files with the same length (CRC-32 is much faster than cryptographic hashes like MD5 or SHA). Finally, for each file with the same CRC-32 it compares the raw binary contents and when it spots the first difference it aborts and marks the files as being different.

The "Save Report" button is disabled because I didn't implement that feature yet.

gary oldmans diary fucked around with this message at 01:21 on Aug 8, 2018

Adbot
ADBOT LOVES YOU

gary oldmans diary
Sep 26, 2005
The previous program had a function to delete all but 1 file from each matched set that I used to use after double-checking the file list for anything strange.

EssOEss posted:

contents cannot match if checksum does not match
That's what I'm thinking. After narrowing potential matches down by file size then CRC-32, it didn't seem like a full byte for byte comparison would be necessary on what remained.

gary oldmans diary
Sep 26, 2005
Is there a way to make do a quick string replace in a binary file from the command line?

Doing it manually for 1 file I would open up my ancient hex editor, find the string "So.Many.Dang.Butts", and type over it with "Just 1 Butt             " (however many spaces needed to match string length). Probably stop after replacing one instance instead of going to the end of the file (option?). Then save in-place without rewriting the entirety of some big old 8GB file every time.

It seems like this tool should already exist somehow.

E: So many near-misses on finding this tool out in the wild.

gary oldmans diary fucked around with this message at 03:20 on Apr 7, 2019

gary oldmans diary
Sep 26, 2005
What's the touchpad device entry look like in device manager?

gary oldmans diary
Sep 26, 2005
Making a dumb batch file to catch up on all shows for specified hours #-# would be so much easier.

code:
for command to read 3 tokens from a prevdate.txt file and set 3 previous date variables
for command to read 'date /T' with / and [space] delimiter and set 3 current date variables from tokens 2-4
for command to generate series of desired hours (
  if currday > prevday (
    for command to generate days from prev to curr (
      call getshow.bat month day year hour
  ) else (
    for command to generate days from prevDay to 31 ^
      get those shows using prevMonth and prevYear
    for command to generate days from 1 to currDay ^
      get those shows using currMonth and currYear
  )
)
for command to select the mp3 files (
  for command to rename them
)
echo current month day year > prevdate.txt

getshow.bat provides leading zeroes with string manipulation to whatever its passed and uses wget to get the MP3s
I bet parsing the webpage as xml in Powershell and solving the problem precisely would look ridiculously elegant if I knew how. :negative:

gary oldmans diary
Sep 26, 2005
In powershell, how can I do something as simple as getting some temporary variables from a file name?
Such as:
FOR /F "delims=-_ tokens=1-3" %D IN ('dir /b ????-??-??_*.*') DO ECHO MM/DD/YYYY: %E/%F/%D

gary oldmans diary fucked around with this message at 11:02 on Sep 19, 2019

Adbot
ADBOT LOVES YOU

gary oldmans diary
Sep 26, 2005
That's just the bridge I needed to progress. Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply