Dear Statalist community,
I just encountered a behavior with the zipfile command in Stata (I tested this in both Stata for Windows and Stata for Linux, version 15.1, fully patched) that I did not expect. On my machines, the suboption replace to the argument saving() does not seem to have an effect if I enclose the target file name in double quotes. Consider the following example code:
The second invocation of zipfile yields
Is this the desired behavior? As I understand, this makes it impossible to create ZIP archives with spaces in their names (not that I would like to do so). Do you think I should raise this as an issue to Stata Technical Services, or do I miss something?
Kind regards
Bela
I just encountered a behavior with the zipfile command in Stata (I tested this in both Stata for Windows and Stata for Linux, version 15.1, fully patched) that I did not expect. On my machines, the suboption replace to the argument saving() does not seem to have an effect if I enclose the target file name in double quotes. Consider the following example code:
Code:
sysuse auto , clear save "testfile1.dta" , replace save "testfile2.dta" , replace zipfile "testfile1.dta" "testfile2.dta" , saving("both_testfiles.zip") // <-- works zipfile "testfile1.dta" "testfile2.dta" , saving(both_testfiles.zip , replace) // <-- works as expected zipfile "testfile1.dta" "testfile2.dta" , saving("both_testfiles.zip" , replace) // <-- doesn't work; sub-option 'replace' does not seem to have an effect
Code:
file already exists
You must specify option replace to overwrite the existing file.
Kind regards
Bela
Comment