Control saving file by type

Is there a way to control that under a specific directory only a file with certain extension is allowed to be saved, others are denied.

For example, only *.txt extension is allowed to be saved in directory /abc, and files with extension .rtf is allowed in /xyz

(I know that UX does not care about file type, but i am hoping somone has come up with something...)

TIA

You might be able to do some scripting in a .enter.sh (.enter.csh is the C shell)
This is the standard name to use for something meant to execute, going
into a directory.

I haven't really monkeyed around with that myself. I just ran across it while
casually flipping through Unix Power Tools.

Here's abit of info on that:

As to *what* you'd put in the script to do that, I'm not sure!

Why are you wanting to accomplish this? I'm just curious, and
letting us know might help in someone coming up with a solution.

Thank you gjduff! I have bunch of users who consistently save their outputs in their code library and code in output library, we have tried every thing short of clobbering 'em over the head...hence the idea that maybe we could systematically enforce the rules.

Thank you again.

Another idea might be possibly to run a cron job
that checks that directory and appends "the extention"
to any file that doesn't have it.
(
Or any file that has a different one, though that would be somewhat
more work. Eww! Work!
Depends if you care about extensions on top of extensions :slight_smile:
)

Also, even though so called "cross posting" is discouraged, you might want
to also ask at www.justlinux.com

I've probably had more luck in finding solutions to "weird, fringe problems"
there than anywhere else, so far.

Hey gjduff, thanks a bunch! By the way your sn is very hard to pronounce 10 times in a row...try it :slight_smile: