Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

To delete a file if the sie of the file is less than 1 blocks in OpenVms

 
SOLVED
Go to solution

To delete a file if the sie of the file is less than 1 blocks in OpenVms

Hi Al,

I need to delete files which get created with 0 blocks. please help me.
i need a command to delete files which are less than 1 block in VMS.
15 REPLIES 15
Craig A
Valued Contributor

Re: To delete a file if the sie of the file is less than 1 blocks in OpenVms

Hi!

This will generate a list of zero block files:

$direct/sel=size=max=1/col=1/nohead/notrail

You can then open up this file, read each record in and issue a $DELETE command.

HTH

Craig
Craig A
Valued Contributor

Re: To delete a file if the sie of the file is less than 1 blocks in OpenVms

Whoops!

And you also need:

/size=all on the $direct command line.

Craig

Re: To delete a file if the sie of the file is less than 1 blocks in OpenVms

I might have 100's of files in a directory.
i want to delete those automatially when i run a COM.
that COM should automatically get all those which has size of 0 blocks and delete. I do not want to manually do it daily.
Craig A
Valued Contributor

Re: To delete a file if the sie of the file is less than 1 blocks in OpenVms

You need:

HELP OPEN
HELP READ
HELP CLOSE

Craig
RBrown_1
Trusted Contributor

Re: To delete a file if the sie of the file is less than 1 blocks in OpenVms


For an alternate method, try F$SEARCH, F$FILE_ATTRIBUTES and DELETE.