scancode-toolkit icon indicating copy to clipboard operation
scancode-toolkit copied to clipboard

output csv fail

Open heyg opened this issue 3 years ago • 3 comments

Hi guys,

I have a problem, when I scan for GPL using "./scancode -l --processes 10 --csv ../result/hardware.csv ${SRC_CODE_PATH}", the "../result" directory doesn't exist, no will generate hardware.csv, I think even if there is no output path, the tool should generate csv (probably generate csv to current path), it will save time for us to scan huge code.

heyg avatar Apr 28 '22 08:04 heyg

@heyg Thanks... are you saying that when we output a file and the directories are missing, any non-existing intermediate directory should be created automatically? like when calling mkdir -p somefoo/bar/baz would create somefoo then somefoo/bar and somefoo/bar/baz? If yes, this could work but I wonder if this would be best enabled with a command line option as this is not a standard, default behaviour in command line tools in general.

pombredanne avatar Apr 28 '22 12:04 pombredanne

@pombredanne Yes.

This ensures that even if there is no output directory (we forgot to create the output directory ourselves), we can still generate files like csv.csv .

Alternatively, check if the output directory exists, thus alerting the person using the tool that "there is no output directory".

heyg avatar Apr 29 '22 04:04 heyg

Alternatively, check if the output directory exists, thus alerting the person using the tool that "there is no output directory".

IMHO that's a better behaviour. the approach we have today is lazy and therefore and to your point the scan may fail at the end because the CSV path is only looked at at the tail end of the scan.

pombredanne avatar Aug 05 '22 10:08 pombredanne