How to add new attributes to a file

I am developing an app for NC. I want to add attributes to files, similar to file_ lock.
What should i do?