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

Limit creation of different files on a directory

SOLVED
Go to solution
FOX MULDER_2
Frequent Advisor

Limit creation of different files on a directory

Is it possible to limit files creation on a particular directory.

e.g
A directory has 4 files in it.
The 5th one needs to be restricted.

The files are all different ofcourse.

Thanks
5 REPLIES
Homer Shoemaker
Frequent Advisor

Re: Limit creation of different files on a directory

Let me ask for a little clarification.

Do you want to limit the directory to no more than four files total?

Also, how are the files being created? If they're being created from within an application, then the application may be able to take care of what you want. Of course, the specifics of how you'd do that would depend on the application.
Homer Shoemaker
Frequent Advisor

Re: Limit creation of different files on a directory

Often times, you'll see the regular posters (with hats) ask, "What problem are you trying to solve?"

That may be a good approach in this case.

They also often ask for specifics about the operating system version, application, and hardware that you're using.

These guys are good at figuring out how to solve problems, and very generous with their help, but I think a little more info from you might be helpful here.
Hoff
Honored Contributor
Solution

Re: Limit creation of different files on a directory

No. Not possible.

Viewed solely with the information available here, this particular solution to the unstated requirement would require code changes within the internals of the OpenVMS file system implementation.

I don't know that I've ever encountered a file system with a four file limit, or anything even remotely similar to this request.

There may well be a solution here, but not to the question posed. What particular application requirement are you working on here here? What problem are you looking to solve? And yes, the version, platform and the usual other questions also apply.
David Jones_21
Trusted Contributor

Re: Limit creation of different files on a directory

It does seem like an odd request.

If have discretion where this restricted directory resides, then you can put it on a virtual disk (i.e. ld device) that that is initialized with /maximum_files=15. The number 15 provided 10 volume meta-data files created when you initialize the volume plus the application directory file plus 4 data files.

You have the issue of sizing the virtual disk to be able ensure the data files don't allocate too much space. If the data files grow sporatically, they can become fragmented. In whic case, you can eventually get HEADERFUL or INDEXFULL errors when it can't get a file extension header.
I'm looking for marbles all day long.
Wim Van den Wyngaert
Honored Contributor

Re: Limit creation of different files on a directory

If aprox x is ok and if no file deletes are done :
run a script every minute or so that counts the files with e.g. f$sea or dir/tot. As soon as the number of files > x you make the directory file read only (thus allowing read/update only).

fwiw

Wim
Wim