AlDanial / cloc

cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.
GNU General Public License v2.0
19.78k stars 1.02k forks source link

--count-and-diff --out=xxxx exception #675

Closed wengjianchuan closed 2 years ago

wengjianchuan commented 2 years ago

cmd :cloc --count-and-diff --out=analysis E:\MyCodeWork\PythonWorkspace\FastCFS_bak E:\MyCodeWork\PythonWorkspace\FastCFS exception:Unable to write to analysis.E:_MyCodeWork_PythonWorkspace_FastCFS_bak.E:_MyCodeWork_PythonWorkspace_FastCF

1661411940588 S

AlDanial commented 2 years ago

The problem comes from the leading E: in front of the two directories (the last two command line arguments). cloc tries to create a windows file name based on file_name plus the embedded E: and that isn't allowed. Until I fix this, run without the letter drive:

cloc.exe --count-and-diff --out=file_name \MyCodeWork\PythonWorkspace\FastCFS_bak \MyCodeWork\PythonWorkspace\FastCFS
AlDanial commented 2 years ago

Fixed in https://github.com/AlDanial/cloc/commit/0995e8ce3abf0a690e46da4a0ad880ed376dc57a .