dalance/amber

Random "Permission denied" error on Windows

No3371 opened this issue · 0 comments

I'm calling amber from a batch script, it executes amber.exe tens of times in order. Some of them will randomly fail.
The script:

:: Replace #1/#2/#3
chcp 65001
echo "%1"
ambr.exe --no-interactive --regex "!\[\]\(https://dictionary\.goo\.ne\.jp/img/daijisen/gaiji/02539\.gif\)" "![[.1.gif]]" %1
ambr.exe --no-interactive --regex "!\[\]\(https://dictionary\.goo\.ne\.jp/img/daijisen/gaiji/02540\.gif\)" "![[.2.gif]]" %1
ambr.exe --no-interactive --regex "!\[\]\(https://dictionary\.goo\.ne\.jp/img/daijisen/gaiji/02541\.gif\)" "![[.3.gif]]" %1
ambr.exe --no-interactive --regex "!\[\]\(https://dictionary\.goo\.ne\.jp/img/daijisen/gaiji/02542\.gif\)" "![[.4.gif]]" %1
ambr.exe --no-interactive --regex "!\[\]\(https://dictionary\.goo\.ne\.jp/img/daijisen/gaiji/02543\.gif\)" "![[.5.gif]]" %1
ambr.exe --no-interactive --regex "!\[\]\(https://dictionary\.goo\.ne\.jp/img/daijisen/gaiji/02544\.gif\)" "![[.6.gif]]" %1
::Extract title
ambr.exe --no-interactive --regex "^# .+ goo国語辞書\n\n\n(.+)\n\nの解説" "# $1" %1
::Compress all second level nodes
ambr.exe --no-interactive --regex "    (\d+\.)  (.+)(?:\n)     " "    $1 $2" %1
ambr.exe --no-interactive --regex "    \n    1." "    1." %1
::Replace all first and only sub example sentence/reference
ambr.exe --regex "^    1.  「" "    >「"" %1
::類語、関連語、下接語
ambr.exe --no-interactive --regex "^類語" "#### 類語" %1
ambr.exe --no-interactive --regex "^関連語" "#### 関連語" %1
ambr.exe --no-interactive --regex "^下接語" "#### 下接語" %1
::Correct first level numbered list bullets
ambr.exe --no-interactive --regex "^1\.  \*\*1\*\*\s?" "1. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*2\*\*\s?" "2. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*3\*\*\s?" "3. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*4\*\*\s?" "4. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*5\*\*\s?" "5. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*6\*\*\s?" "6. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*7\*\*\s?" "7. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*8\*\*\s?" "8. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*9\*\*\s?" "9. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*10\*\*\s?" "10. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*11\*\*\s?" "11. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*12\*\*\s?" "12. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*13\*\*\s?" "13. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*14\*\*\s?" "14. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*15\*\*\s?" "15. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*16\*\*\s?" "16. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*17\*\*\s?" "17. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*18\*\*\s?" "18. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*19\*\*\s?" "19. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*20\*\*\s?" "20. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*21\*\*\s?" "21. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*22\*\*\s?" "22. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*23\*\*\s?" "23. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*24\*\*\s?" "24. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*25\*\*\s?" "25. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*26\*\*\s?" "26. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*27\*\*\s?" "27. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*28\*\*\s?" "28. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*29\*\*\s?" "29. " %1
ambr.exe --no-interactive --regex "^1\.  \*\*30\*\*\s?" "30. " %1

The random fails looks like this:

>ambr.exe --no-interactive --regex "^1\.  \*\*4\*\*\s?" "4. " ../aaa.md
Error: permission denied @ "../aaa.md" <<<<<
Found .gitignore at the parent directory: ".."

>ambr.exe --no-interactive --regex "^1\.  \*\*5\*\*\s?" "5. " ../aaa.md
Found .gitignore at the parent directory: ".."

>ambr.exe --no-interactive --regex "^1\.  \*\*6\*\*\s?" "6. " ../aaa.md
Found .gitignore at the parent directory: ".."

>ambr.exe --no-interactive --regex "^1\.  \*\*7\*\*\s?" "7. " ../aaa.md
Found .gitignore at the parent directory: ".."

>ambr.exe --no-interactive --regex "^1\.  \*\*8\*\*\s?" "8. " ../aaa.md
Error: permission denied @ "../aaa.md" <<<<<
Found .gitignore at the parent directory: ".."

>ambr.exe --no-interactive --regex "^1\.  \*\*9\*\*\s?" "9. " ../aaa.md
Found .gitignore at the parent directory: ".."