Skip to content

Commit

Permalink
Speedy GonFiles version 0.70.00
Browse files Browse the repository at this point in the history
  • Loading branch information
CanisLupus committed Apr 26, 2021
0 parents commit f1af2cd
Show file tree
Hide file tree
Showing 15 changed files with 3,986 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Ignore everything by default.
*

# But not these...
!.gitignore
!README.md
!LICENSE

!/project/

!/project/Speedy GonFiles.sln
!/project/Speedy GonFiles.vcxproj
!/project/Speedy GonFiles.vcxproj.filters
!/project/Speedy GonFiles.vcxproj.user

!/project/include/
!/project/include/**

!/project/res/
!/project/res/**

!/project/src/
!/project/src/**
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
zlib/libpng License (Zlib)

Copyright (c) 2021 Daniel Lobo

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

3. This notice may not be removed or altered from any source distribution.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Speedy GonFiles
=================

## Description

Speedy GonFiles is a fast Windows program to find duplicate files. Run the program and drag files/folders to the window. It will process all the files and mark any duplicates with colors.

It was heavily inspired by [HashMyFiles](https://www.nirsoft.net/utils/hash_my_files.html), which I frequently used to check for duplicates. However, instead of focusing on applying commonly known hashes and showing duplicate files as a by-product, Speedy GonFiles focuses on finding duplicates, so it only hashes files for comparison (with the very fast [Meow hash](https://github.com/cmuratori/meow_hash)) if multiple files have the same size. It can also add files inside folders recursively, unlike HashMyFiles.

## Requirements

- Windows 10, 64 bits
- x64 CPU with AES-NI (Meow hash requirement)

NOTE: 32-bit Windows is NOT supported. Older versions of Windows or somewhat old CPUs were not tested, so it may or may not work, or may simply become slow. Feel free to try if you want.

## Project

### Building

Open the solution (`project/Speedy GonFiles.sln`) in Visual Studio and run it. 😉 You need to have the Visual Studio module *Desktop development with C++* installed. I used Visual Studio 16.9.2.

### Code

The full program is mostly a single file, `project/src/program.cpp` (there are also external files for Meow hash, Timsort, and application resources). Although it's not my usual style, this project was small enough to comfortably develop and organize in one file. I also greatly prefer to read code written by others on as few files as it makes sense, instead of searching for all behaviours and data in dozens of files, so hopefully you will understand. 😄

Although this is a C++ project and uses the STD, there are no new classes or "modern" C++ features. It's very C-based, using only structs and functions. There are no forward declarations, so a function can only use things above itself. The entry point (wWinMain) is thus the last function.

This is my first complete project using the Win32 API, so please forgive the inevitable non-standard code. I wanted to learn how to create most things from code, including menus, so the use of resource (.rc) files only to have the (default) application icon is intentional.

### Possible improvements

- Read all the file paths and sizes from NFTS records on the Master File Table. It would probably be *much* faster than calling Windows APIs once per file, despite also being much harder to implement. Programs like WizTree index millions of files in a few seconds on an SSD, so it should be doable.

- Add file icons. I actually have code for this but it proved extremely slow and I didn't research it further, so it was left defined-out. Maybe reading them in a separate thread would work better? Maybe there are just better ways...?

## Credits / Licenses

Speedy GonFiles was made by Daniel Lobo and is published under the zlib license.

[Meow hash](https://github.com/cmuratori/meow_hash) 0.5/calico, used in this project, was developed by Casey Muratori and Jacob Christian Munch-Andersen, with additional contributions from other people. It is provided via the zlib license.

[timsort](https://github.com/patperry/timsort), used in this project, was developed by Patrick O. Perry as a port of the Java/Android version of Timsort, which in turn is a port of the original for Python, by Tim Peters. It is provided via the Apache License, version 2.0.

###### Yes, Speedy GonFiles is a bad pun on Speedy Gonzáles.
31 changes: 31 additions & 0 deletions project/Speedy GonFiles.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31112.23
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Speedy GonFiles", "Speedy GonFiles.vcxproj", "{7CDA69AB-099F-4FFA-9115-00EF192E9C30}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7CDA69AB-099F-4FFA-9115-00EF192E9C30}.Debug|x64.ActiveCfg = Debug|x64
{7CDA69AB-099F-4FFA-9115-00EF192E9C30}.Debug|x64.Build.0 = Debug|x64
{7CDA69AB-099F-4FFA-9115-00EF192E9C30}.Debug|x86.ActiveCfg = Debug|Win32
{7CDA69AB-099F-4FFA-9115-00EF192E9C30}.Debug|x86.Build.0 = Debug|Win32
{7CDA69AB-099F-4FFA-9115-00EF192E9C30}.Release|x64.ActiveCfg = Release|x64
{7CDA69AB-099F-4FFA-9115-00EF192E9C30}.Release|x64.Build.0 = Release|x64
{7CDA69AB-099F-4FFA-9115-00EF192E9C30}.Release|x86.ActiveCfg = Release|Win32
{7CDA69AB-099F-4FFA-9115-00EF192E9C30}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C0EDFB16-3CB9-42C9-9F40-4477114B898E}
EndGlobalSection
EndGlobal
163 changes: 163 additions & 0 deletions project/Speedy GonFiles.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<Image Include="res\program.ico" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="res\resource.h" />
<ClInclude Include="res\targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\program.cpp" />
<ClCompile Include="src\timsort.c" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\program.rc" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{7cda69ab-099f-4ffa-9115-00ef192e9c30}</ProjectGuid>
<RootNamespace>duplicatesfinder</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>Speedy GonFiles</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
43 changes: 43 additions & 0 deletions project/Speedy GonFiles.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<Image Include="res\program.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<ClInclude Include="res\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="res\targetver.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\program.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\timsort.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\program.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions project/Speedy GonFiles.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
Loading

0 comments on commit f1af2cd

Please sign in to comment.