Re: Easy DCL question PURGE vs. DELETE
- From: Doug Phillips <dphill46@xxxxxxxxxxxx>
- Date: Sat, 04 Aug 2007 13:42:48 -0700
Sorry again, but this time for the length of the post.
On Aug 4, 12:58 pm, AEF <spamsink2...@xxxxxxxxx> wrote:
On Aug 4, 12:55 pm, Doug Phillips <dphil...@xxxxxxxxxxxx> wrote:
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.
I can see it both ways. The advantage of the current way is that you
can delete all files older than a certain time except that the current
version is always kept. How would you do this with your desired
algorithm?
There is *no* advantage to the current action of /keep. It does *not*
do what you describe above, as has been demonstrated here and
elsewhere --- unless you're allowing the definition of "current
version" to fall outside of the list of files that should be selected
by the filespec and its qualifiers.
To be more explicit, let's use the example above. Suppose I want to
get rid of all files older than 16:37:07, except to not delete the
current version even if it too is older. I can do
Which do you consider the "current version"??
$ PURGE BLAH.TMP /BEFORE=16:37:07
By your command, purge should *ignore* all files named BLAH.TMP that
are dated *on or since* 16:37:07, as well as all files with any other
name that might reside within the current directory. So BLAH.TMP;9 and
BLAH.TMP;8 should be completely ignored --- just as a file named
BLAH.BLAH and all other files not matching your request should be
ignored.
That means you are selecting these files for purge to process:
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
By your command, purge should keep the highest version of the selected
files, and purge the rest.
That leaves BLAH.TMP;7 as the only remaining file that matches your
specification.
If you do a DIR BLAH.TMP after the purge, you should see:
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
That is, two files that you didn't specify in your purge command, and
the "most current" version of the one you did.
If you want purge to delete files that don't match your specs &
qualifiers, then that's beyond my understanding.
and versions 7 thru 5 will be deleted. You can't do that with your
desired algorithm. You can counter by saying, well you should use
DELETE.
I will! If you want to DELETE files, use the DELETE command. If you
want to PURGE files, use the PURGE command. THEY ARE NOT THE SAME
COMMAND. (excuse me, I'll try to use my indoor voice from now on;)
Well I can counter by saying suppose I want to do the same
command except using the time 17:00 but be sure the current version is
unconditionally not deleted:
$ PURGE BLAH.TMP /BEFORE=17
Now, all versions satisfy the criterion but the first one is kept.
This way I can freely construct commands like this and be sure that I
always leave the current version intact. There is no way to do this
with the algorithm you prefer without an unreaonable amount of pain.
That would work the same as if you didn't use the /before. All
existing BLAH.TMP files match your request, so all except the highest
will be purged. What are you asking?
If you don't like the current algorithm you can always just add one to
the number you would otherwise supply to the /KEEP qualifier. But if
your algorithm is implemented there is not way, short of writing a
multi-line DCL procedure (or a painful /EXCLUDE qualifier), to do what
I want as described just above.
You'd really accept that? "HELP PURGE /KEEP --- To keep 3 versions of
a file, specify /KEEP=4" ?? Sorry, there's something about that that
just seems wrong.
Why would I want this? To protect my self from user error. Using
DELETE is riskier. With PURGE I can be assured that I won't
inadvertently delete all versions of a file.
Exactly.
I see it this way:
$ PURGE ! Delete all but the current version
[of each unique filename.ext in the current directory] Right
$ PURGE/BEFORE=time ! Consider the same versions for deletion as in
PURGE, but delete only the versions that meet the /BEFORE=time
criterion.
Wrong. It should consider only the files that the command specifies:
those dated /before=time. It should ignore *all* other files
regardless of their name, version, age, color, religion, creed,
national origin,....(sorry, mind wandered there for a bit.) You are
wanting PURGE to act like DELETE --- and, btw, DELETE, DIR, COPY,
BACKUP, RENAME,... only consider the files you specify, and I wouldn't
want it any other way.
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 doc is ambigiuous for /KEEP. I already proved this.
I don't think the doc is ambiguous, and I don't find any "proof" in
your statements.
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.
It depends on what you mean by "file".
Okay, Bill Clinton;-)
I can have multiple versions of
one file. That use of file means one file. But each version is itself
a "file", but in another sense, which then means multiple files.
Besides, /BEFORE "selects" which versions can be deleted. The
parameter "specifies" which files are to be PURGEd.
No. The parameter specifies which files should be considered by the
purge command. Anywhere from zero to many files might be actually
purged.
Put a * or % wild-card in the file spec someplace and think about how
that fits what you say.
The /KEEP says how many of the SELECTED files should be kept if more
than that number exist. The default is one.
That's not what the doc says. The doc says this:
/KEEP=number-of-versions
Specifies the maximum number of versions of the specified files to be
retained in the directory. If you do not include the /KEEP qualifier,
all but the highest numbered version of the specified files are
deleted from the directory.
Other than the word count and perspective (selected vs specified) how
does what I said contradict the doc?
It the perspective? Here: the purge command should "select" only the
files that you "specify." Clearer?
It's too vague to be of any use. Besides, you specify with the
parameter. The qualifiers select, not specify.
To me, it reads clear and precise. I think you're just refusing to
accept it.
Without other qualifiers, this is what /KEEP=n means as I see it: Put
the n highest versions on an exclude list. Delete the others. If there
are fewer than n versions, do nothing.
That's not the same.
Well, it looks like the same meaning, just worded differently. Your
"exclude" list, I would think of more as a count of matching files.
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
It's specified, not selected.
Perspective. We specify; PURGE selects files based upon our
specification. PURGE, the actor in that sentence, doesn't specify.
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.
And here we disagree. And we will always disagree on this.
Um. On what do you disagree here? That /KEEP *doesn't* mean keep???
So use /KEEP=2 and you'll get what you want. If the algorithm of PURGE
is changed to what you want it to be then I won't be able to do what I
want without writing a multiline DCL procedure.
I still don't follow this, and I don't find anyplace where you've
actually explained it clearly.
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.
But commands like DELETE/BEFORE='time' risk the deletion of all
versions of a file. So I can't use DELETE without having to look at
the version number(s) I wish to keep and putting it(them) in the
exclude qualifier, which would only work if only one file is
specified. If multiple files are specified then I don't think you
could do it even with /EXCLUDE without explicitly typing out the full
name, type, and version number of each and every version I want to
keep (because there's no sticky-default action with /EXCLUDE!). What a
pain! It's much easier to use /KEEP=2 if you want to do it your way.
Sorry. Don't follow that at all.
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.
I'm struggling because I find it difficult to put my thoughts into
words. And I'm trying to be precise and explicit because words such as
earlier, older, file, version, etc. are not precise enough. I'm also
hoping that some variation of my explanation will make my point of
view clear to you.
Sorry. I haven't gotten it yet.
No, the doc is not clear and precise. If I just told you to get me a
maximum of three apples, how many will you bring? That's precise? "Oh,
get me anywhere from zero to three apples, okay?" That's what the
description of /KEEP is saying.
To completely satisfy the command:
"Bring me a maximum of three apples, peon"
"Yes, Sire, oh Gracious One. I am forever your humble servant." (bow,
bow, bow, turn, leave room, run to the larder)
If there are three or more apples I would bring you three apples.
If there are fewer than three apples, I would bring you however many
there are.
That means that if there are no apples, I couldn't bring you any, but
I would never bring you more than the three (MAX) that you requested.
Bringing fewer than 3, though, might cost me my head so I'd probably
pop out to the grocer and resupply the larder. I don't think the PURGE
command should do that, however.
;-)
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=...>
[...]
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.
See? There's too little whitespace. It clutters the visual field of
the mind and makes concentrating all that more difficult. Highly
unreadable.
In Google, there is an option to switch to fixed font. Click on
Options up in the colored title bar and you should find it. I hope
that helps. I found that by accident one day.
You may as well try reading AUTOGEN.COM or STARTUP.COM. To
repeat the previous sentence in ITRC format:
YoumayaswelltryreadingAUTOGEN.COMorSTARTUP.COM. ;-) At least here it's
in a fixed-width font (I'm writing this reply in Wordpad and will
paste it into the Google Groups too-small input window.) And why both
the creation and modification dates? Ugh.
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.
Same thing, different color. All the same arguments apply. If you
don't like it use /KEEP=2.
???????
Read it again. Hopefully the fixed font option helped. He *did* say /
KEEP=2 and it only kept ONE! My friend, that's a bug whether you
accept it or not.
If you respond, please address my arguments instead of repeating
yours. I tried to repeat only the portions of my post you didn't
address. OK, maybe I'm just as guilty.
I've tried. I hope we can still be friends 'cause I doubt anyone else
is going to speak to us after all of these long posts we seem to
generate:-)
I said I can see it both ways. I prefer "my way" and you prefer "your
way". When done my way, you need only add 1 to whatever you supply to
the /KEEP qualifier when using other qualifiers. With your way I have
to go through a lot of pain to delete all versions that match the
selection qualifiers except to keep the current version
unconditionally. Why do you want to make it so painful for me?
I don't want to do anything other than have a command work the way it
says it should.
.
- Follow-Ups:
- Re: Easy DCL question PURGE vs. DELETE
- From: AEF
- Re: Easy DCL question PURGE vs. DELETE
- References:
- Easy DCL question PURGE vs. DELETE
- From: norm . raphael
- Re: Easy DCL question PURGE vs. DELETE
- From: JF Mezei
- Re: Easy DCL question PURGE vs. DELETE
- From: briggs
- Re: Easy DCL question PURGE vs. DELETE
- From: AEF
- Re: Easy DCL question PURGE vs. DELETE
- From: Doug Phillips
- Re: Easy DCL question PURGE vs. DELETE
- From: AEF
- Re: Easy DCL question PURGE vs. DELETE
- From: Doug Phillips
- Re: Easy DCL question PURGE vs. DELETE
- From: AEF
- Re: Easy DCL question PURGE vs. DELETE
- From: Doug Phillips
- Re: Easy DCL question PURGE vs. DELETE
- From: AEF
- Re: Easy DCL question PURGE vs. DELETE
- From: Doug Phillips
- Re: Easy DCL question PURGE vs. DELETE
- From: AEF
- Easy DCL question PURGE vs. DELETE
- Prev by Date: RE: Kerry needs a news reader
- Next by Date: Re: July the 4th
- Previous by thread: Re: Easy DCL question PURGE vs. DELETE
- Next by thread: Re: Easy DCL question PURGE vs. DELETE
- Index(es):
Relevant Pages
|
Loading