From 59bdf90775242acbce05bddc1bca52439a8e817a Mon Sep 17 00:00:00 2001 From: Sarahtonin Date: Sun, 5 Apr 2026 23:43:15 +0200 Subject: [PATCH 1/8] Added case sensitivity to sorting. --- Config.toml | 2 +- DirConfig.toml | 11 +++++++---- SaraSortd.py | 8 +++++++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Config.toml b/Config.toml index 22a084c..2494d5a 100644 --- a/Config.toml +++ b/Config.toml @@ -2,7 +2,7 @@ Title = "SaraSortd Config" SafeMode = 1 SilentMode = 0 CheckInput = 3 -DotFiles = 1 +DotFiles = 0 [Variables] NextNum = "!" diff --git a/DirConfig.toml b/DirConfig.toml index 1717d62..929d90e 100644 --- a/DirConfig.toml +++ b/DirConfig.toml @@ -1,8 +1,11 @@ Title = "Unset" -Files = [ - {Pattern = "*", NewFileName = "~^", NextNum = 1, NextChar = "A"}, -] +[[Files]] +Pattern = "*" +NewFileName = "~^" +NextNum = 1 +NextChar = "A" +CaseSensitive = 0 LastFile = "Unset" -ParentDir = "Unset" +ParentDir = "Unset" \ No newline at end of file diff --git a/SaraSortd.py b/SaraSortd.py index 257b1be..e841864 100644 --- a/SaraSortd.py +++ b/SaraSortd.py @@ -241,7 +241,13 @@ def DecideNewPath(FilePath): LogWrite(TextOutput) Speak(TextOutput) - if fnmatch.fnmatch(UnsortedFile, Pattern): + if (File["CaseSensitive"] == 1): + Match = fnmatch.fnmatchcase(UnsortedFile, Pattern) + + else: + Match = fnmatch.fnmatch(UnsortedFile.lower(), Pattern.lower()) + + if Match: NewFileName = File["NewFileName"] if (ConfVars["NextNum"] in NewFileName): From 332b071fabc5f1695466484240366bc8fd9713d3 Mon Sep 17 00:00:00 2001 From: Sarahtonin Date: Mon, 6 Apr 2026 00:02:22 +0200 Subject: [PATCH 2/8] Added a Running parameter to Config.toml. If it's 1, the program runs. If it's 0, it stops. --- Config.toml | 7 ++++--- SaraSortd.py | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Config.toml b/Config.toml index 2494d5a..320598b 100644 --- a/Config.toml +++ b/Config.toml @@ -1,4 +1,5 @@ Title = "SaraSortd Config" +Running = 0 SafeMode = 1 SilentMode = 0 CheckInput = 3 @@ -19,9 +20,9 @@ Second = "[s]" VarCall = "%%" [DirectoryPaths] -RootDir = "Unset" -InputDir = [ "%RootDir%"] -OutputDir = [ "%RootDir%/Output"] +RootDir = ["Unset"] +InputDir = [ "%RootDir%",] +OutputDir = [ "%RootDir%/Output",] LogDir = "%RootDir%/.Logs" FailedDir = "%RootDir%/.Failed" diff --git a/SaraSortd.py b/SaraSortd.py index e841864..93223cb 100644 --- a/SaraSortd.py +++ b/SaraSortd.py @@ -310,6 +310,7 @@ def Init(): LogWrite(TextOutput) Speak(TextOutput) + UpdateConf(ConfPath, "Running", 1) Main() else: @@ -326,7 +327,7 @@ def Main(): Output = Parse(String = Output) Dir(Output) - while True: + while (GetConf("Running", ConfPath) == 1): for Input in ConfDirs["InputDir"]: InputPath = Parse(Input) From 8ffcaadba5d3964dc118d1bd413a2a491dc0bb09 Mon Sep 17 00:00:00 2001 From: Sarahtonin Date: Mon, 6 Apr 2026 00:11:24 +0200 Subject: [PATCH 3/8] Added Logging parameter in Config.toml to turn off or on the logging system. --- Config.toml | 7 ++++--- SaraSortd.py | 13 +++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Config.toml b/Config.toml index 320598b..3063d2d 100644 --- a/Config.toml +++ b/Config.toml @@ -4,6 +4,7 @@ SafeMode = 1 SilentMode = 0 CheckInput = 3 DotFiles = 0 +Logging = 1 [Variables] NextNum = "!" @@ -20,9 +21,9 @@ Second = "[s]" VarCall = "%%" [DirectoryPaths] -RootDir = ["Unset"] -InputDir = [ "%RootDir%",] -OutputDir = [ "%RootDir%/Output",] +RootDir = "Unset" +InputDir = [ "%RootDir%"] +OutputDir = [ "%RootDir%/Output"] LogDir = "%RootDir%/.Logs" FailedDir = "%RootDir%/.Failed" diff --git a/SaraSortd.py b/SaraSortd.py index 93223cb..72d1aec 100644 --- a/SaraSortd.py +++ b/SaraSortd.py @@ -207,12 +207,13 @@ def Dir(Path, Output = True, CopyConf = True): def LogWrite(Text): - if (ConfDirs["LogDir"] != None and ConfNames != "Unset"): - if (ConfNames["LogFileName"] != None and ConfNames["LogFileName"] != "Unset"): - Dir(Parse(String = ConfDirs["LogDir"], Path = ConfPath), Output = False, CopyConf = False) - LogFile = f"{Parse(String = ConfDirs["LogDir"], Path = ConfPath)}/{Parse(String = ConfNames["LogFileName"], Path = ConfPath)}.log" - with open(LogFile, "a", encoding="utf-8", buffering=1) as File: - File.write(f"{Parse(String = ConfLog["All"], Path = ConfPath)}{Text}\n") + if (GetConf("Logging", ConfPath) == 1): + if (ConfDirs["LogDir"] != None and ConfNames != "Unset"): + if (ConfNames["LogFileName"] != None and ConfNames["LogFileName"] != "Unset"): + Dir(Parse(String = ConfDirs["LogDir"], Path = ConfPath), Output = False, CopyConf = False) + LogFile = f"{Parse(String = ConfDirs["LogDir"], Path = ConfPath)}/{Parse(String = ConfNames["LogFileName"], Path = ConfPath)}.log" + with open(LogFile, "a", encoding="utf-8", buffering=1) as File: + File.write(f"{Parse(String = ConfLog["All"], Path = ConfPath)}{Text}\n") def DecideNewPath(FilePath): From bf454bf09b54feea1446e3ea8493cf9ba344cc52 Mon Sep 17 00:00:00 2001 From: Sarahtonin Date: Mon, 6 Apr 2026 01:08:57 +0200 Subject: [PATCH 4/8] Removed Running, since it's very ineffective. --- Config.toml | 2 +- SaraSortd.py | 37 +++++++++++++++++++++---------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/Config.toml b/Config.toml index 3063d2d..6891c07 100644 --- a/Config.toml +++ b/Config.toml @@ -1,5 +1,4 @@ Title = "SaraSortd Config" -Running = 0 SafeMode = 1 SilentMode = 0 CheckInput = 3 @@ -35,6 +34,7 @@ DirConfName = ".@Config" All = "[h]:[n]:[s] | " Start = "Started SaraSortd." NotStart = "Error: Failed to start SaraSortd." +Stop = "\nStopped SaraSortd." MatchPattern = "Checking %%." Sorted = "Sorted %%." NotSorted = "Error: Failed to sort %%. No valid output directory." diff --git a/SaraSortd.py b/SaraSortd.py index 72d1aec..355e458 100644 --- a/SaraSortd.py +++ b/SaraSortd.py @@ -311,7 +311,6 @@ def Init(): LogWrite(TextOutput) Speak(TextOutput) - UpdateConf(ConfPath, "Running", 1) Main() else: @@ -327,24 +326,30 @@ def Main(): for Output in ConfDirs["OutputDir"]: Output = Parse(String = Output) Dir(Output) + + try: + while True: + for Input in ConfDirs["InputDir"]: + InputPath = Parse(Input) + + if not os.path.exists(InputPath): + continue - while (GetConf("Running", ConfPath) == 1): - for Input in ConfDirs["InputDir"]: - InputPath = Parse(Input) - - if not os.path.exists(InputPath): - continue + for FileName in os.listdir(InputPath): + FilePath = os.path.join(InputPath, FileName) - for FileName in os.listdir(InputPath): - FilePath = os.path.join(InputPath, FileName) + if os.path.isfile(FilePath): + FileName = os.path.basename(FilePath) + if (FileName.startswith(".") and Conf["DotFiles"] == 0): + continue + Sort(FilePath) + + time.sleep(Conf.get("CheckInput", 10)) - if os.path.isfile(FilePath): - FileName = os.path.basename(FilePath) - if (FileName.startswith(".") and Conf["DotFiles"] == 0): - continue - Sort(FilePath) - - time.sleep(Conf.get("CheckInput", 10)) + except KeyboardInterrupt: + TextOutput = GetConf("Stop", ConfPath) + LogWrite(TextOutput) + Speak(TextOutput) Init() \ No newline at end of file From 5dbc03ff7f1b78e2918c6c76d459ff76d4a819e1 Mon Sep 17 00:00:00 2001 From: Sarahtonin Date: Mon, 6 Apr 2026 01:19:30 +0200 Subject: [PATCH 5/8] Fixed DirConf to change the LastFile value to the last file sorted in the folder. --- DirConfig.toml | 12 +++++++++--- SaraSortd.py | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/DirConfig.toml b/DirConfig.toml index 929d90e..5a86105 100644 --- a/DirConfig.toml +++ b/DirConfig.toml @@ -1,11 +1,17 @@ Title = "Unset" +LastFile = "Unset" +ParentDir = "Unset" [[Files]] -Pattern = "*" +Pattern = "*.jpg" NewFileName = "~^" NextNum = 1 NextChar = "A" CaseSensitive = 0 -LastFile = "Unset" -ParentDir = "Unset" \ No newline at end of file +[[Files]] +Pattern = "*.png" +NewFileName = "~^" +NextNum = 1 +NextChar = "A" +CaseSensitive = 0 \ No newline at end of file diff --git a/SaraSortd.py b/SaraSortd.py index 355e458..7dc9118 100644 --- a/SaraSortd.py +++ b/SaraSortd.py @@ -282,7 +282,8 @@ def Sort(FilePath): try: Clone(FilePath, NewDirPath, NewName, True) - + UpdateConf(f"{NewDirPath}/{Parse(String = ConfNames["DirConfName"], Parent = os.path.basename(NewDirPath))}.toml", "LastFile", NewName) + TextOutput = Parse(String = ConfLog["Sorted"], VarCall = f"{FilePath} to {NewDirPath}/{NewName}") LogWrite(TextOutput) Speak(TextOutput) From 42adeae8b7f953aa969fcfbb50750eb3f4bd80b8 Mon Sep 17 00:00:00 2001 From: Sarahtonin Date: Mon, 6 Apr 2026 01:41:24 +0200 Subject: [PATCH 6/8] Added an option to write directory configs or not. --- Config.toml | 3 ++- DirConfig.toml | 9 +-------- SaraSortd.py | 9 +++++---- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Config.toml b/Config.toml index 6891c07..22e4afe 100644 --- a/Config.toml +++ b/Config.toml @@ -4,6 +4,7 @@ SilentMode = 0 CheckInput = 3 DotFiles = 0 Logging = 1 +WriteDirConf = 1 [Variables] NextNum = "!" @@ -21,7 +22,7 @@ VarCall = "%%" [DirectoryPaths] RootDir = "Unset" -InputDir = [ "%RootDir%"] +InputDir = [ "%Pic%/Input"] OutputDir = [ "%RootDir%/Output"] LogDir = "%RootDir%/.Logs" FailedDir = "%RootDir%/.Failed" diff --git a/DirConfig.toml b/DirConfig.toml index 5a86105..8db519d 100644 --- a/DirConfig.toml +++ b/DirConfig.toml @@ -3,14 +3,7 @@ LastFile = "Unset" ParentDir = "Unset" [[Files]] -Pattern = "*.jpg" -NewFileName = "~^" -NextNum = 1 -NextChar = "A" -CaseSensitive = 0 - -[[Files]] -Pattern = "*.png" +Pattern = "*" NewFileName = "~^" NextNum = 1 NextChar = "A" diff --git a/SaraSortd.py b/SaraSortd.py index 7dc9118..83a7b93 100644 --- a/SaraSortd.py +++ b/SaraSortd.py @@ -194,10 +194,11 @@ def Dir(Path, Output = True, CopyConf = True): os.makedirs(Path, exist_ok=True) if (CopyConf): - Clone("DirConfig.toml", Path, f"{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml") - - UpdateConf(f"{Path}/{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml", "ParentDir", ParentName) - UpdateConf(f"{Path}/{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml", "Title", f"{ParentName} Config") + NewDirConf = f"{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml" + if (Conf["WriteDirConf"] == 1 or not os.path.exists(os.path.join(f"{Path}/{NewDirConf}"))): + Clone("DirConfig.toml", Path, NewDirConf) + UpdateConf(f"{Path}/{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml", "ParentDir", ParentName) + UpdateConf(f"{Path}/{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml", "Title", f"{ParentName} Config") if (Output): ParsedPath = Parse(String = Path) From 6feca9ba32f9f7750944f7ad88a7f036627136d8 Mon Sep 17 00:00:00 2001 From: Sarahtonin Date: Mon, 6 Apr 2026 01:43:10 +0200 Subject: [PATCH 7/8] Changed "WriteDirConf" to "OverwriteDirConf" so that it makes more sense what it does. --- Config.toml | 2 +- SaraSortd.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Config.toml b/Config.toml index 22e4afe..8a3e3d9 100644 --- a/Config.toml +++ b/Config.toml @@ -4,7 +4,7 @@ SilentMode = 0 CheckInput = 3 DotFiles = 0 Logging = 1 -WriteDirConf = 1 +OverwriteDirConf = 0 [Variables] NextNum = "!" diff --git a/SaraSortd.py b/SaraSortd.py index 83a7b93..c1329a8 100644 --- a/SaraSortd.py +++ b/SaraSortd.py @@ -195,7 +195,7 @@ def Dir(Path, Output = True, CopyConf = True): if (CopyConf): NewDirConf = f"{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml" - if (Conf["WriteDirConf"] == 1 or not os.path.exists(os.path.join(f"{Path}/{NewDirConf}"))): + if (Conf["OverwriteDirConf"] == 1 or not os.path.exists(os.path.join(f"{Path}/{NewDirConf}"))): Clone("DirConfig.toml", Path, NewDirConf) UpdateConf(f"{Path}/{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml", "ParentDir", ParentName) UpdateConf(f"{Path}/{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml", "Title", f"{ParentName} Config") From ca0dde695d5b3a87512be41d474b264fcea5d572 Mon Sep 17 00:00:00 2001 From: Sarahtonin Date: Mon, 6 Apr 2026 02:40:37 +0200 Subject: [PATCH 8/8] Updated README to be correct and up-to-date. Also moved it and LICENSE into .Github for better management of files. --- LICENSE => .Github/LICENSE | 0 .Github/README.md | 131 +++++++++++++++++++++++++++++++++++++ README.md | 82 ----------------------- 3 files changed, 131 insertions(+), 82 deletions(-) rename LICENSE => .Github/LICENSE (100%) create mode 100644 .Github/README.md delete mode 100644 README.md diff --git a/LICENSE b/.Github/LICENSE similarity index 100% rename from LICENSE rename to .Github/LICENSE diff --git a/.Github/README.md b/.Github/README.md new file mode 100644 index 0000000..4a8d47c --- /dev/null +++ b/.Github/README.md @@ -0,0 +1,131 @@ +# SaraSortd +A python daemon that can automatically sort your files to your liking without using AI. + +It's made by Sarah, hence the name. :3 + +## Dependencies +toml: Use ```pip install toml``` to install toml. + +## Config explanation + +### SaraSortd Config (Config.toml) + +``` +Title = "SaraSortd Config" # NOTE: Do not change the title. + +SafeMode = 1 # If SaraSortd should stop if an error with the config appears. 1 is stop, 0 is continue. + +SilentMode = 0 # If SaraSortd should write things it does, to the terminal. + +CheckInput = 3 # How many seconds it takes for SaraSortd to check input directories for new files to sort. + +DotFiles = 0 # If SaraSortd should sort files that begin with ".". This is mainly for linux users, since hidden files always have "." in front of them. + +Logging = 1 # If SaraSortd's logging system should be active. If this is 0, nothing will be logged into files. + +OverwriteDirConf = 0 # If SaraSortd should overwrite directory configs with DirConfig.toml. + +[Variables] # Only use these in config files, not the actual file names themselves. +NextNum = "*" # The next available number. If 1 already exists, 2 will be used. Starts at 1. + +NextChar = "&" # The next available character. If A already exists, B will be used. + +Parent = "@" # The name of the parent directory. + +OrgFileName = "\~" # The original name of the sorted file. If "blahblah.txt" gets sorted, "~" would be equal to "blahblah". + +OrgFileType = "^" # The original file type of the sorted file. If "example.png" gets sorted, "^" would be equal to ".png". + +Year = "[y]" # The current year, E.G. "2026". + +Month = "[m]" # The date of the current month, E.G. "03". + +Day = "[d]" # The date of the current day, E.G. "27". + +Hour = "[h]" # The current hour, E.G. "12". + +Minute = "[n]" # The current minute, E.G. "44". + +Second = "[s]" # The current second, E.G. "11". + +VarCall = "%%" # The characters used at the start and end of variable calls. The first character is to the left; second is to the right. NOTE: If any parameters in the config uses just "%%", it gets a variable from the program itself, not from the config. + +[DirectoryPaths] +RootDir = "Unset" # A variable directory. This doesn't NEED to exist for the program to work. It's more of a shorthand for other paths to use! You could add more of these. E.G: Add ImageDir = "%RootDir%/Images", then you could set OutputDir to be "%ImageDir%". + +InputDir = ["%RootDir%"] # If files get put here, they'll be sorted. This is a list, so you can add multiple. E.G: ["%RootDir%", "%RootDir%/input"] + +OutputDir = ["%RootDir%/Output"] # Where sorted files go. This is a list, so you can add multiple. E.G: ["%RootDir%/Output", "%RootDir%/Output2"]. The output directories have separate config files. + +LogDir = "%RootDir%/.Logs" # Where log files from SaraSortd go. + +FailedDir ="%RootDir%/.Failed" # For files that failed to be sorted. + +[Names] +LogFileName = "[y].[m].[d]._*" # Name for log files. + +DirConfName = ".@Config" # Name for config files for directories. + +[Log] +All = "[h]:[n]:[s] | " # What to put at the start of all lines in Log file. + +Start = "Started: SaraSortd" # When SaraSortd starts. + +NotStart = "Error: Failed to start SaraSortd." # When SaraSortd fails to start for some reason. + +Stop = "\nStopped SaraSortd." # When SaraSortd stops for whatever reason. Usually when you interrupt it in the terminal you ran it in. + +MatchPattern = "Checking %%." # When a file that's trying to be sorted gets checked against a pattern. +# %% here is the file against the pattern. E.G: "picture.png against *.jpg" + +Sorted = "Sorted: %%." # When a file gets sorted and where. +# %% here is the oldfile to the newfile, E.G: "picture.png to SortedPicture.png". + +NotSorted = "Error: Failed to sort %%. No valid output directory." # When a file from an input directory fails to be sorted to an output directory. +# %% here is the path of the file. E.G: "/home/janedoe/picture.png". + +ValueSet = "Set: %%." # When a value in a config is set. +# %% here is the parameter and what it got set to. E.G: "Title to TestDir Config File". + +Unset = "Error: %% is not set." # When a value isn't set. +# %% here is just the parameter who's value was either "Unset" or None. E.G: "RootDir". +``` + +### Output Directory Config (DirConfig.toml) + +The output directory config references the SaraSortd config (Config.toml). This means that you can, for example, use the character assigned to "NextNum" in Config.toml in this config (DirConfig.toml). This applies to all Variables in the SaraSortd config (Config.toml). + +``` +Title = "Unset" # The title of the config. This currently does nothing for SaraSortd, so it can be anything. It gets automatically updated when DirConfig.toml gets copied to an output directory. + +LastFile = "Unset" # The last file that was sorted to this directory. It gets automatically updated whenever a file gets sorted to this directory. + +ParentDir = "Unset" # The name of this directory. It gets automatically updated when DirConfig.toml gets copied to an output directory. + +[[Files]] # The double brackets means that you can add multiple types of files to be sorted here. Just copy [[Files]] and all the parameters under it, and paste it under or over this section, then you may change the values of the new parameters. E.G: + +# [[Files]] +# Pattern = "*.png" +# NewFileName = "GoodImage^" +# NextNum = 1 +# NextChar = "A" +# CaseSensitive = 0 +# [[Files]] +# Pattern = "*.jpg" +# NewFileName = "BetterImage^" +# NextNum = 1 +# NextChar = "A" +# CaseSensitive = 0 + +# Will sort .png files to this directory and rename them to "GoodImage.png", but also sort .jpg files into this directory yet rename those to "BetterImage.jpg". + +Pattern = "*" # A pattern used to sort files to this directory. * is a wildcard; ? is a one-character wildcard. E.G: if Pattern is "*.png", all files ending with .png will end up here. + +NewFileName = "~^" # A pattern for the new names of the files that get sorted to this directory from matching this "Pattern". + +NextNum = 1 # Used to keep track of the next available number for file names. It gets automatically incremented when NextNum is used in NewFileName, and a file gets sorted to this directory and renamed. + +NextChar = "A" # Used to keep track of the next available letter for file names. It gets automatically incremented (E.G: A into B) when NextChar is used in NewFileName, and a file gets sorted to this directory and renamed. + +CaseSensitive = 0 # Whether this "Pattern" is case-sensitive or not. 1 is yes, 0 is no. E.G: if CaseSensitive = 1 and this "Pattern" is "*.PNG", a file named "picture.png" won't get sorted to this directory. if CaseSensitive = 0 and this "Pattern" is "*.PNG", a file named "picture.png" *will* get sorted to this directory. +``` \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 2383583..0000000 --- a/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# SaraSortd -A python daemon that can automatically sort your files to your liking without using AI. - -It's made by Sarah, hence the name. :3 - -## Dependencies -toml: Use ```pip install toml``` to install toml. - -## Config explanation - -### SaraSortd Config (Config.toml) - -``` -Title = "SaraSortd Config" # NOTE: Do not change the title. - -SafeMode = 1 # If SaraSortd should stop if an error with the config appears. 1 is stop, 0 is continue. -SilentMode = 0 # If SaraSortd should write stuff to the terminal as well. - -CheckInput = 10 # How many seconds it takes for SaraSortd to check input directories for new files to sort. - -[Variables] # Only use these in config files, not the actual file names themselves. -NextNum = "*" # The next available number. If 1 already exists, 2 will be used. Starts at 1. -NextChar = "&" # The next available character. If A already exists, B will be used. - -Parent = "@" # The name of the parent directory. - -OrgFileName = "\~" # The original name of the sorted file. If "blahblah.txt" gets sorted, "~" would be equal to "blahblah". -OrgFileType = "^" # The original file type of the sorted file. If "example.png" gets sorted, "^" would be equal to ".png". - -Year = "[y]" # The current year, E.G. "2026". -Month = "[m]" # The date of the current month, E.G. "03". -Day = "[d]" # The date of the current day, E.G. "27". - -Hour = "[h]" # The current hour, E.G. "12". -Minute = "[n]" # The current minute, E.G. "44". -Second = "[s]" # The current second, E.G. "11". - -VarCall = "%%" # The characters used at the start and end of variable calls. The first character is to the left; second is to the right. NOTE: If any parameters in the config uses just "%%", it gets a variable from the program itself, not from the config. - -[DirectoryPaths] -RootDir = "/home/sarah/TESTDIR" # Parent directory. Directory where all SaraSortd directories live. -InputDir = ["%RootDir%"] # If files get put here, they'll be sorted. -OutputDir = ["%RootDir%/Output"] # Where sortted files go. -LogDir = "%RootDir%/.Logs" # Where log files from SaraSortd go. -FailedDir ="%RootDir%/.Failed" # For files that failed to be sorted. - -[Names] -LogFileName = "[y].[m].[d]._*" # Name of log files. -DirConfName = ".@Config" # Name of config files for directories. - -[Log] -All = "[h]:[n]:[s] | " # What to put at the start of all lines in Log file. - -Start = "Started: SaraSortd" # When SaraSortd starts. -NotStart = "Error: Failed to start SaraSortd." # When SaraSortd fails to start for some reason. - -Sorted = "Sorted: %% to %%." # When a file gets sorted. -ValueSet = "Set: %% to be %% in %%." # When a value in a config is set. - -WrongType = "Error: %% is not a %%." # When a parameter in the config is of the wrong type. E.G. setting a text parameter to be a list. -Unset = "Error: %% is not set." # When a parameter in the config is not set. %% is the parameter that wasn't set. -``` - -### Directory Config (DirConfig.toml) - -``` -Title = "Unset" # NOTE: Do not change the title. - -Files = [ - {Pattern = "?", NewFileName = "~^", NextNum = 1, NextChar = "A"}, -] -# Pattern: the pattern used to sort files here. * is a wildcard, ? is a one-character wildcard. -# E.G: if Pattern is "*.png", all files ending with .png will end up here. - -# NewFileName: the pattern for the new names of the files that get sorted here. - -# NextNum and Nextchar: used to keep track of the next -# available number and character for file names. - -LastFile = "Unset" # The last modified file in the directory. -ParentDir = "Unset" # The name of the parent directory. -``` \ No newline at end of file