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
0 Response to zipfile sub-option 'saving(... , replace)' not working with quoted target file name?
Post a Comment