Re: Easy DCL question PURGE vs. DELETE



*Sorry if this posts twice; Google told me that it posted
successfully, then told me it hadn't yet posted when I tried to leave
the page:-( a Google-Gurgle? )

On Aug 4, 8:50 am, AEF <spamsink2...@xxxxxxxxx> wrote:
On Aug 3, 5:49 pm, Doug Phillips <dphil...@xxxxxxxxxxxx> wrote:

On Aug 3, 3:46 pm, AEF <spamsink2...@xxxxxxxxx> wrote:

[...]

How is it a bug?

$ DIR/WID=FILE=15/NOSIZE

Directory SYS$SYSDEVICE:[TEST]

BLAH.TMP;9 3-AUG-2007 16:37:08.15
BLAH.TMP;8 3-AUG-2007 16:37:07.53
BLAH.TMP;7 3-AUG-2007 16:37:06.78
BLAH.TMP;6 3-AUG-2007 16:37:06.07
BLAH.TMP;5 3-AUG-2007 16:37:05.33
BLAH.TMP;4 3-AUG-2007 16:37:04.50
BLAH.TMP;3 3-AUG-2007 16:37:03.68
BLAH.TMP;2 3-AUG-2007 16:37:02.80
BLAH.TMP;1 3-AUG-2007 16:37:01.68

Total of 9 files.
$

What would you expect for

A $ PURGE BLAH.TMP /BEFORE=16:37:06
B $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=1
C $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=2
D $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=3

For each of those, I would expect that if I did

$ DIR/BEFORE=16:37:06

I would see the same files that PURGE would select for consideration;

BLAH.TMP;5 3-AUG-2007 16:37:05.33
BLAH.TMP;4 3-AUG-2007 16:37:04.50
BLAH.TMP;3 3-AUG-2007 16:37:03.68
BLAH.TMP;2 3-AUG-2007 16:37:02.80
BLAH.TMP;1 3-AUG-2007 16:37:01.68

For your example A & B, I would expect to end up with:

BLAH.TMP;9 3-AUG-2007 16:37:08.15
BLAH.TMP;8 3-AUG-2007 16:37:07.53
BLAH.TMP;7 3-AUG-2007 16:37:06.78
BLAH.TMP;6 3-AUG-2007 16:37:06.07
BLAH.TMP;5 3-AUG-2007 16:37:05.33

Hmmm. Since ;5 is before the time given to /BEFORE, and since it is
not the highest version, I'd expect it to be deleted. Why would you
expect ;5 to remain?


Because the command is PURGE, *not* DELETE. Purge is supposed to keep
the highest (to a maximum of the specified number of) version(s) of
the *specified* files if any files match the selection criteria. The
default is the _specified_file(s)_ with the highest version number(s).
If you want to DELETE the files, then use DELETE. PURGE is *not*
DELETE.

Already we're in disagreement. OK.


How unusual;-)

There's no way I'm going to quote your entire novella of a post(;-))),
but I'll try to address some of your confusion. You might have to go
back and reread your own post to understand some of the points I'm
addressing.


There are various ways to mix /KEEP and /BEFORE. One could apply /
KEEP=n first, mark those n files as keepers, and then delete any
others that are timestamped before the specified time t0. That's one
way to do it -- method 1. OK. Method 2: The way you appear to favor is
that we look at the files that are timestamped as being before time
t0, and apply /KEEP=n solely within those. The third way is what VMS
does -- method 3.


There is no "my way". There is no "mix" of /KEEP and /BEFORE. These
PURGE qualifiers are precisely explained in the HELP and the Doc's.
You are fighting those definitions trying to find an explanation that
fits how the command malfunctions. You are trying to apply the logic
of the DELETE command to PURGE. PURGE is not DELETE!

The /BEFORE qualifier is a FILE SELECTOR. It says select files dated
before this date. That's the way /BEFORE works in this command and all
of the other DCL commands where it's used. That is as simple as it
gets.

The /KEEP says how many of the SELECTED files should be kept if more
than that number exist. The default is one. Purge removes any files
with version numbers lower than the files you tell it to keep (by spec
or default, always at least one if at least one file is selected.) It
says *nothing* about how many files should be purged (deleted, if you
prefer.) It says how many should be *kept*. That's also as simple as
it gets. PURGE, by definition, should *always* keep at least ONE of
the files selected by the file spec and all other file selection
qualifiers that you provide, if any exist, and it should keep the
number of files you specify if that many exist. /KEEP means keep, not
delete.

There should be no way for purge to delete every *selected* file.
That's what DELETE is for, and because DELETE can remove all versions
of files, it requires a more precise file spec. Again, PURGE is not
DELETE.

I guess I can only keep repeating what the documentation says, because
that's the way it *should* work. But, that's not the way it works.

In reading everything you've written, I see you struggling. Your
attempted "simplifications" show you are fighting the fact that the
way PURGE works is not the way it was intended to work. PURGE is *NOT*
DELETE. If you read the HELP and the doc's again, keeping that fact in
mind, I think you'll see that the explanations are clear and precise.

In the ITRC discussion, Jon Pinkley demonstrated that the bug is not
limited to the /BEFORE qualifier. I hope he doesn't mind if I quote
some of his post here:

########################################################
<quote Jon Pinkley; http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1093051>
[...]
This discussion has convinced me that the behavior should be as you
describe, since the "selected files" should be the set of files
selected by the filespec and the qualifiers. The bug in purge is not
limited to /before as is demonstrated by the following:

$ show system/noproc ! not portable ...
OpenVMS V8.3 on node SIGMA 23-FEB-2007 22:23:30.28 Uptime 1 00:56:43
$ analyze/image/select=(id,link) sys$system:delete.exe; ! not portable
SYS$COMMON:[SYSEXE]DELETE.EXE;1
"X-05"
29-JUN-2006 18:18:42.45
$ directory/own/date=(cre,mod) pt.tmp;*

Directory SYS$SYSROOT:[SYSMGR]

PT.TMP;5 1-JAN-2000 01:00:31.11 1-JAN-2000 01:01:31.11 [SYSTEM]
PT.TMP;4 2-JAN-2000 01:00:30.99 2-JAN-2000 01:01:30.99 [1,1]
PT.TMP;3 3-JAN-2000 01:00:30.88 3-JAN-2000 01:01:30.88 [1,1]
PT.TMP;2 4-JAN-2000 01:00:30.78 4-JAN-2000 01:01:30.78 [SYSTEM]
PT.TMP;1 5-JAN-2000 01:00:30.64 5-JAN-2000 01:01:30.64 [SYSTEM]

Total of 5 files.
$ purge/keep=2/by_own=[1,1]/log pt.tmp
%PURGE-I-FILPURG, SYS$SYSROOT:[SYSMGR]PT.TMP;3 deleted (0 blocks)
$ directory/own/date=(cre,mod) pt.tmp;*

Directory SYS$SYSROOT:[SYSMGR]

PT.TMP;5 1-JAN-2000 01:00:31.11 1-JAN-2000 01:01:31.11 [SYSTEM]
PT.TMP;4 2-JAN-2000 01:00:30.99 2-JAN-2000 01:01:30.99 [1,1]
PT.TMP;2 4-JAN-2000 01:00:30.78 4-JAN-2000 01:01:30.78 [SYSTEM]
PT.TMP;1 5-JAN-2000 01:00:30.64 5-JAN-2000 01:01:30.64 [SYSTEM]

Total of 4 files.

I have tested this on 7.2-2, 7.3-2 and 8.3, they all show this
behavior. Including reproducer as attachment.

I think I have narrowed the conditions necessary to exhibit bug.

Some definitions:

Selection set: The set of files that meet the filespec and qualifiers.

Statement of problem:

If the highest version of a specific device:[directory]file.type is
not a member of the selection set, and /keep versions > 1, then one
less file is kept than specified by the /keep qualifier.

Expected cause: from source listings: [V732.DELETE.LIS]PURGE.LIS
(which was more handy than 8.3)

In routine purge_ods2_files, at line 931 there is a check for a change
in device, directory, name or type. If there is change, then in line
936 the versions (matching purge selection) is unconditionally set to
1, i.e. no check is made to see if this meets the requirements of the
common qualifiers. If it isn't the highest version, then the routine
purge_this_file is called. purge_this_file calls DEL$MATCH_FILENAME
which checks if the file matches the selection criteria, and if so
increments the versions seen, and if gtr than the specified /keep
versions, deletes the file.
[...]
</quote>
####################################################

I believe this was formally reported to HP. I do not know its current
status.

.



Relevant Pages

  • Re: Easy DCL question PURGE vs. DELETE
    ... Because the command is PURGE, ... PURGE qualifiers are precisely explained in the HELP and the Doc's. ... The qualifiers select, not specify. ... Selection set: The set of files that meet the filespec and qualifiers. ...
    (comp.os.vms)
  • Re: Easy DCL question PURGE vs. DELETE
    ... PURGE is *not* ... By your command, purge should keep the highest version of the selected ... qualifiers, ... a file, specify /KEEP=4" ?? ...
    (comp.os.vms)
  • Re: Easy DCL question PURGE vs. DELETE
    ... the *specified* files if any files match the selection criteria. ... that satisfy the selection qualifiers. ... Now I think the simplest way to summarize this is that PURGE currently ... It should consider only the files that the command specifies: ...
    (comp.os.vms)
  • Re: Easy DCL question PURGE vs. DELETE
    ... Specify one of the following ... when other qualifiers are not specified at all. ... current version and the n-1 highest versions of the files subject to ... purge leaving only the one versioncreated before the time ...
    (comp.os.vms)
  • Re: RCM - Welding newsgroup
    ... You can set the "Purge" selection in the Group of ... AGENT section to delete these "no longer available " messages which ... on your news server. ...
    (rec.crafts.metalworking)