Skip to content
Simple File Tagging tool written in C99 without dependencies
C Roff Meson
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


sftagger - simple file tagging tool
sftagger is a simple file tagging tool written in C

Current Stable Version: 2018/03/31 (3.0 Release (C version))
Development Version: 2020-02-07 (4.0-a1)

Always use the stable version over the development version as development 
version are prone to breaking your "tags" file.

Enter the following commands to build and install sftagger:

    $ meson builddir/ && cd builddir/
    $ ninja 

- See manpage

Depreciated commands (by 4.0)
- To be decided

Depreciated commands (by 2.0)
- create - Creates/overwrites the tags file - REASON: add category does it, and
           tags-to replaces it
- update - Updates the tags file - REASON: No need as tags-to replaces it
- list - Replaced by categories

Using search
Use xargs to make use of the outputs to the program you want to use it with

    $ sftagger search foo | xargs sxiv

Replace "foo" with your searches (can be more than one keyword(s)) and "sxiv"
with your program of choice

- libc (C89 and above are supported)

Tested on
- Linux
    - Debian Unstable GNU/Linux using GCC and Clang - 2018/02/01
    - Void Linux using GCC - 2018/07/01
    - OpenBSD 6.2 using Clang

TODO (For future releases)
- More bug-fixes and preventions in place
- Inherited subcategories (Not sure how it will be implemented yet)
- Have proper buffering
- Bug to fix: Unable to handle file with lines more than ~3-6k

- 4.0
    - 2020-02-07
        - sftagger rework
            - C89 now
            - Just some few setups
    - 2019-01-18 (4.0-a01)
        - complete sftagger rework
            - sqlite3 instead of flat files
            - arguments options changed to a more UNIX-like format
- 3.1
    - 2018/07/02 (3.1 RC3)
        - "sftagger add/rename/remove" doesn't segmentation fault anymore
        - Additional error message
        - More comments
    - 2018/07/02 (3.1 RC2)
        - Array of struct with function pointer to a function as a solution to
          if/else on parameter matching (in main function)
            - Thanks to: Xunie for advising this solution
            - main function replaces par2 function (par2 function removed)
    - 2018/06/01 (3.1 RC1)
        - Cleaner to read parameter checking if statements
        - Bug fix: Fixed inserting new files prioritising upper-case filenames
        - README tabs screw ups fixed
- 3.0
    - 2018/03/31 (3.0 Release)
        - Released as 3.0
        - Bug fix: Fixed renaming tag messing up tags
        - Bug fix: Fixed empty category/tag being shown in "show-tags"
        - Manpage: Slight change under search example
        - 2018/02/23 (3.0 RC1)
        - Moved from alpha to release candidate
        - Bug fix: "Bus Error" on large amount (more new than old) of new
          files/directory being added got fixed
        - Bug fix: Filenames with only 1 tags being removed when 
          adding/removing tags
    - 2018/02/11 (3.0a-05)
        - Source code: Added const to source parameters
        - Source code: All memcpy size determined by string length of source +
        1 rather than size of destination
    - 2018/02/08 (3.0a-04)
        - Bug fix: Fix when altering tags numbers puts up an extra line
    - 2018/02/08 (3.0a-03)
        - Bug fix: Array use malloc, no longer segmentation faults on very
        large list of files
    - 2018/02/06 (3.0a-02)
        - Bug fix: A workaround done to handle larger tag files (more than ~6k
        files able to handle now) in which previously fails to segmentation
        - Bug fix: Categories output not properly done if there's an empty
        category in between now fixed, empty categories shown differently now
    - 2018/02/01 (3.0a-01)
        - 2.1 versions named properly in changelog and skipped versioning 2.1
          for 3.0
        - Improvements: "categories" command also outputs the amount of files
          each tags has, and the total of files under per category. Also has
          slightly different formatting.
        - New feature: Outputs all files available using "sftagger all"
        - New feature: Outputs all tags (and category per tag) under the 
          filenames given using "sftagger show-tags"
- 2.1
    - 2018/01/31 (2.1 RC2)
        - Fixed quick sort not sorting properly when it comes to lower amount
          of items
    - 2018/01/30 (2.1 RC1)
        - More efficient way of sorting: Changed from bubble sort to quick sort
    - Source code: Source no longer de-references while nothing need to 
      modify to it
- 2.0
    - 2018/01/10 (2.0 Release)
        - Dots, forward-slashes, dashes, and underscores exempt from as special
    - Current directory's database tag-file exempt from being added
    - File/tags-to message change: "New file added:" to "New file/directory
    - Bug fix: Tags properly added on rather than having part of the 
    - Bug fix: Tags that needed to be removed are removed properly without 
      also removing other tags after it
    - Bug fix: Renaming category: Empty category fixed to format properly
    - Bug fix: Renaming tags: Prevented duplicated tags
    - Incompatible with 1.0 and 2.0 RC3
    - 2018/01/09 (2.0 RC3)
        - Improvement: Filenames with special characters are dealt with 
    - Bug fix: Usage/Error message fixed to show all commands available
    - Incompatible with RC2
    - 2018/01/06 (2.0 RC2)
        - RC2-1: Fixed Makefile and category to remove not showing up in the 
          warning message
        - Source code: Changed all sprintf to snprintf, strcat to strncat, and 
          strcpy to memcpy to comply with OpenBSD warnings.
    - Tag adding more verbose
    - Bug fix: Tags adding: Fixed numbers not being updated
    - 2018/01/06 (2.0 RC1)
        - New feature: File's tag and file removing
    - Bug fix: Tags adding: Spaced filenames added properly
    - New man page included
    - 2018/01/05 (2.0a-05)
        - New feature: Category removing
    - 2018/01/04 (2.0a-04)
        - New feature: Tag removing
    - 2018/01/04 (2.0a-03)
        - New feature: Category and tag renaming
    - 2018/01/02 (2.0a-02)
        - Makefile: Reverted back to cc (GCC for GNU/Linux) rather than 
      specifically clang
    - Bug fix: Tags adding: First tag/tag 0 properly checked upon 
    - 2018/01/02 (2.0a-01)
        - Change the way "add tags-to" and "add categories" command works 
      (replaces create and update commands)
    - Update command no longer available
    - Create command legacy
    - No longer creates "category: placeholder" on top line
- 1.0
    - 2017/12/31 (1.0 Release)
        - Bug fix: Searching: Prevented when 0 valid tags given from searching
        - README changed from md to text format
    - 2017/12/29 (1.0 RC3)
        - Bug fix: Fixed numbers +3 of what they should be
        - Incompatible with RC2
        - Source code: Fewer indents and obey 80 columns rule
    - 2017/12/28 (1.0 RC2)
        - Bug fix: Tag adding: Fixed numbers not being updated
        - Bug fix: Tag adding: Fixed duplication not checked outside of its 
        - Added: ability to list out of all both categories and tags
    - 2017/12/27 (1.0 RC1)
        - Bug fix: Fixed line not fully cleared
        - Added: ability to list out categories
        - Added: ability to list out tags of its category
        - Portability: Used fgets over getline
        - Makefile now included
        - More documented README
    - 2017/12/26
        - Added: files searching via tags
        - Added: file updating (Only adds new, doesn't remove deleted/
    - 2017/12/25
        - Added: tags adding to files and tags duplication checking
    - 2017/12/24
        - Added: new tags creation to a category and tags duplication checking
    - 2017/12/23
        - Added: new categories creation and categories duplication checking
        - Added: "tags" file creation

You can’t perform that action at this time.