[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Strange SA/NV behavior--BK is culprit



Carl Distefano wrote:
Reply to note from Paul Lagasse  Sat, 17 Oct
2009 07:43:52 -0400

Paul:
In my case, resetting the flag is not desirable. If I were to
save when I've not altered a file, I would end up with FILE and
FILE.BAK being identical, and lose the old version stored as
FILE.BAK.

I don't think so. Your routine performs the COPY command first,
before SAving, right? (If you trace the GoLabel...LaBel sequence,
you'll see that it does.) If the file has not changed on disk, you
would simply be copying the same file contents over the existing
.BAK file. The file date of the .BAK file would be refreshed, but
the file contents would not change. In any event, you can avoid the
unnecessary .BAK file refresh by doing COPY/NV only if VA$MO is 1.
Yes, COPY is performed first, but the problem -- unless I'm missing something in what you said -- is this.
Before that copying occurs, FILE.BAK is older (has fewer or different
edits) than FILE. If I use a routine to force VA$MO to 1 to ensure
backups in those few instances (such as a changed case and the like)
where Xy4 has not registered the change to the open FILE, then FILE
will always be backed up even if I've made no changes to FILE.
As a result, first the FILE on disk (which is identical to the unedited
open version) is copied to FILE.BAK, then the open FILE is saved. So
FILE and FILE.BAK are now identical, and the differences that did exist
are lost.
Here's your routine, with a forced SAve (and no LaBels); .BAK files
are handled the same as in yours:
I've real no problem with this approach to SA and BAK, but won't the following run into trouble when a directory in the path has an extension? -Paul
XPLeNCODE v2.0
b-gin [UNTITLED]
{<}IF{<}VA$MO{>}>0{>}{<}SX01,{<}VA$FP{>}{>}[BX_]exist {<}PV01
{>}[Q2_]{<}IF@NOT({<}ER{>}){>}{<}SX02,{<}IS01{>}{>}{<}IF{<}IS
01{>}{240}"."{>}{<}SV02,.{>}{<}XS01,02,02,03,03{>}{<}EI{>}[BX
_]copy/nv {<}PV01{>} {<}PV02{>}.BAK[Q2_]{<}EI{>}{<}EI{>}[GT_]
{<}SV01,{>}{<}GT01{>}[BX_]sa[Q2_]{<}IF@NOT({<}ER{>}){>}{<}PRF
ile saved{>}{<}EI{>}{<}EX{>}[cr|lf][cr|lf]
-nd
XPLeNCODE