HP OpenVMS Systems

ask the wizard
Content starts here

DCL COPY, RENAME, and date arcana?

» close window

The Question is:

If I copy a file and rename it in one go
	eg. copy x.tmp [.c]t.tmp
then the created/modified dates are set to the current date
However if I do it in two steps
	copy x.tmp [.c]
	rename x.tmp t.tmp
Then the created date is left alone, only the modified date is updated.
Why the difference?

The Answer is :

  This oddity is an artifact of how RENAME and how COPY work.
  COPY will reset the dates to reflect a new (and newly-named)
  file, while RENAME will preserve attributes.

answer written or last revised on ( 29-APR-2002 )

» close window