0

I am new in Programming. Let's get straight to the subject. I want to add a new attribute to a file using Java. For example, Every file has default attribute like Date modified, Date created etc. I want to add a new attribute to a file, say Rating.

Is it possible? then How can I do that ?

I've spend a lot of time in google, but nothing found helpful.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
theapache64
  • 10,926
  • 9
  • 65
  • 108

1 Answers1

3

The existing attributes are defined and stored in the file system of the underlying operating system. Examples of file systems are NTFS and FAT32.

Some file systems allow for storing additional attributes for a given file, but it is rare, and even if you used one that did, you still need code either inside the runtime library or your own code which could talk to the underlying operating system to get and set the values you want to store.

At your current programming level, I would suggest looking into another solution to what you want to do this for. The typical way to save data is by talking to a database or - for smaller amounts of data - XML.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347