boyter / scc

Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go
MIT License
6.65k stars 264 forks source link

Format Multi Does not Respect Absolute Output Paths #290

Open eng-import-dd opened 3 years ago

eng-import-dd commented 3 years ago
  1. using scc as command line
  2. Arguments scc C:\\CAFlowRepos\ESW-AI\CAFlow_b0f26719165ec78445cee86c22bca9f1aa27a378 --by-file --format-multi "tabular:C:\\folder\\tabular.txt,csv:stdout" --cocomo-project-type "custom,1,1,1,1"

Expected behavior

  1. C:\folder\tabular.txt should be created with tabular data inside.

However removing the absolute path with relative path for format multiple works fine, the only limitation is that the output file can only be created inside the scanning directory. scc C:\\CAFlowRepos\ESW-AI\CAFlow_b0f26719165ec78445cee86c22bca9f1aa27a378 --by-file --format-multi "tabular:tabular.txt,csv:stdout" --cocomo-project-type "custom,1,1,1,1" Works Fine.

Desktop (please complete the following information):

boyter commented 2 years ago

Interestingly this appears to be a windows issue, as it appears to work perfectly on macOS at least.

$ scc --by-file --format-multi "tabular:/tmp/test.txt" && ls /tmp/*.txt && wc -l /tmp/test.txt

/tmp/test.txt
     385 /tmp/test.txt

I will need to investigate this a bit more as I don't think there should be anything stopping it. Will try on a windows machine soon.

boyter commented 2 years ago

@eng-import-dd if you are able to build from master let me know, as I stupidly was eating an error which might be the issue here. If not let me know and I can produce a windows build and attach it here. This should at least establish if its a permission error.