organize
organize copied to clipboard
Winerror when trying to exclude specific files in folder
Hello,
I wrote this rule:
And I am getting this error when running organize sim
:
In the logs I have that:
2021-04-07 20:13:51,169 - organize - ERROR - [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\Users\\mma\\Downloads\\*Netflix*.csv' Traceback (most recent call last): File "c:\users\mma\appdata\local\programs\python\python37\lib\site-packages\organize\cli.py", line 77, in main execute_rules(config.rules, simulate=args["sim"]) File "c:\users\mma\appdata\local\programs\python\python37\lib\site-packages\organize\core.py", line 92, in execute_rules failed, succeded = run_jobs(jobs=jobs, simulate=simulate) File "c:\users\mma\appdata\local\programs\python\python37\lib\site-packages\organize\core.py", line 154, in run_jobs for job in sorted(jobs, key=lambda x: (x.folderstr, x.basedir, x.path)): File "c:\users\mma\appdata\local\programs\python\python37\lib\site-packages\organize\core.py", line 105, in create_jobs for folderstr, basedir, path in all_files_for_rule(rule): File "c:\users\mma\appdata\local\programs\python\python37\lib\site-packages\organize\core.py", line 124, in all_files_for_rule basedir, globstr = splitglob(folderstr.lstrip("!").strip()) File "c:\users\mma\appdata\local\programs\python\python37\lib\site-packages\organize\utils.py", line 14, in splitglob path = fullpath(globstr.strip()) File "c:\users\mma\appdata\local\programs\python\python37\lib\site-packages\organize\utils.py", line 24, in fullpath return Path(os.path.expandvars(str(path))).expanduser().resolve(strict=False) File "c:\users\mma\appdata\local\programs\python\python37\lib\pathlib.py", line 1144, in resolve s = self._flavour.resolve(self, strict=strict) File "c:\users\mma\appdata\local\programs\python\python37\lib\pathlib.py", line 201, in resolve s = self._ext_to_normal(_getfinalpathname(s)) OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\Users\\mma\\Downloads\\*Netflix*.csv'
Seeing that in the documentation
I should be able to exclude files with wildcards after adding them.
Hello, there were some problems on windows with the previous versions. Could you please try again with the newly released v2?
I should add that the folder exclusion syntax has changed. Please use the new location options or exclude the name with "not":
rules:
- locations: ~/Downloads
filters:
- not name:
contains: Netflix
- extension: ["docx", "xlsx", "csv"]
actions:
- move: ~/Downloads/Documents