File level asserts.

R

Roedy Green

I have various directories for various purposes. For example I have a
directory with nothing by 32 x 32 png files it in. In others there in
nothing but HTML.

I would be nice to have like a file assert system that could enforce
additional rules e.g.

1. files you save must be in a certain size range.

2. files must be a certain type

3. images must past a rightsize image dimension check. see
http://mindprod.com/jgloss/rightsize.html

4. must pass user written custom asserts encoded in Java.

You would need some hook to monitor saves done by any app.

Have you ever heard of such a thing written in Java?
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Species evolve exactly as if they were adapting as best they could to a changing world, and not at all as if they were moving toward a set goal."
~ George Gaylord Simpson
 
M

Mark Space

Roedy said:
I have various directories for various purposes. For example I have a
directory with nothing by 32 x 32 png files it in. In others there in
nothing but HTML.

I would be nice to have like a file assert system that could enforce
additional rules e.g.


This sounds inverted, to me. In other words, these constraints should
not be properties of files, but rather the file should be a property of
the object. It's the object that has additional constraints -- must be a
certain type, must be an image of a certain size, etc.

The problem with file constraints is that the rest of the system is not
so constrained. Anyone could add any file to any subdir, and your
system has to deal with it, somehow. Placing the constraint on the
object when it's created or read from a file seems the more normal way
to do this.
 
A

Arne Vajhøj

Roedy said:
I have various directories for various purposes. For example I have a
directory with nothing by 32 x 32 png files it in. In others there in
nothing but HTML.

I would be nice to have like a file assert system that could enforce
additional rules e.g.

1. files you save must be in a certain size range.

2. files must be a certain type

3. images must past a rightsize image dimension check. see
http://mindprod.com/jgloss/rightsize.html

4. must pass user written custom asserts encoded in Java.

You would need some hook to monitor saves done by any app.

Have you ever heard of such a thing written in Java?

"any app"
=>
OS hook
=>
Java is not the right language AND different solutions needed for
Windows and *nix

Arne
 
R

Roedy Green

I would be nice to have like a file assert system that could enforce
additional rules e.g.

Other sorts of special restrictions - which program s can read, which
can write.

The intent is not high security, but more avoiding accidentally
writing stuff in the wrong directory.

--
Roedy Green Canadian Mind Products
http://mindprod.com

"Species evolve exactly as if they were adapting as best they could to a changing world, and not at all as if they were moving toward a set goal."
~ George Gaylord Simpson
 
R

Roedy Green

Java is not the right language AND different solutions needed for
Windows and *nix

It depends on how similar the hooks are you can get from Vista and
Unix. If the gods smile, you might be able to use a common JNI API.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Species evolve exactly as if they were adapting as best they could to a changing world, and not at all as if they were moving toward a set goal."
~ George Gaylord Simpson
 
A

Arne Vajhøj

Roedy said:
It depends on how similar the hooks are you can get from Vista and
Unix. If the gods smile, you might be able to use a common JNI API.

It can happen.

But no smiles in this case.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top