Would be good to have two separate -replace- options, one to allow the
archive to be changed at all, and the second to allow replacing the
files with the same names already in archive. E.g.
1) zipfile .... , saving(archive.zip, replace)
allows allows adding files to archive, modifying archive in general
2) zipfile ....., saving(archive.zip, replace) replace
allows adding files to archive and replacing files already there with
newer files
The manual could be more explicit about what currently implemented
option replace is implying.
Best, Sergiy
On Tue, Oct 27, 2009 at 8:42 AM, Martin Weiss <[email protected]> wrote:
>
> <>
>
> If you want my take on this, the problem is in line 44 of zipfile.ado which
> reads
>
>
> *************
> gettoken comma 0 : 0
> *************
>
> and probably needs a " , parse(", ")":
>
> -gettoken- normally identifies tokens by watching out for blanks, as its
> help file indicates. If, in your call to -zipfile-, you do not provide it
> with a blank after the comma separating the zipfilename from its options, it
> cannot tell that -replace- has been specified, and stashes -replace- into
> the "comma" macro. The line 45 " gettoken replace 0 : 0" never gets a chance
> to do its magic as "comma" has already eaten its lunch. The subsequent -if-s
> then -somewhat correctly- identify a problem with the -saving- option when
> really the problem lies in the parsing...
>
>
> HTH
> Martin
>
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> [mailto:[email protected]] Im Auftrag von Fred Wolfe
> Gesendet: Dienstag, 27. Oktober 2009 13:01
> An: [email protected]
> Betreff: st: Probable bug in -zipfile-
>
> I used -zipfile- for the first time and obtained an error with the
> first syntax. Stata usually lets one use "save,replace" even if the
> file does not exist. So the behavior below was unexpected and kind of
> a nuisance. And it is contrary to the help file.
>
> . zipfile eq5d2.dta, saving(eq5d2,replace)
> option saving() misspecified
> r(198);
>
> . zipfile eq5d2.dta, saving(eq5d2)
> adding: eq5d2.dta
> successfully zipped eq5d2.zip
>
> Fred
> --
> Fred Wolfe
> National Data Bank for Rheumatic Diseases
> Wichita, Kansas
> NDB Office +1 316 263 2125 Ext 0
> Research Office +1 316 686 9195
> [email protected]
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/