python - Attribute system similar to HTTP Headers for local files -
i in process of writing program , need guidance. essentially, trying determine if file has marker or flag attached it. sort of attributes http header.
if such marker exists, file manipulated in way (moved directory).
my question is: should storing flag/marker? files have system similar http headers? don't want access or manipulate contents of file, kind of property of file can edited without corrupting actual file--and must rather universal among file types potential domain of file types unbound. have experience web apis familiar http headers , json. similar system exist local files in windows? interested in has professional/industry knowledge of common techniques programmers use when trying store 'meta data' in files in order access them later. or if knows of point me, unsure should researching.
for record, going write program windows using golang or python. , files going manipulate potentially common ones (.docx, .txt, .pdf, etc.)
thanks in advanced!
metadata wish add best kept in separate file or database files.
or in file same name , different extension or prefix, can make hidden.
relying on file system tricky , data bound restrictions , capabilities of file system file stored on. and, cannot count on data remaining intact application may wish change these flags.
and of have specific, defined use, such creation time, modification time, access time...
see, if need flagging document, may wish use creation time, stay unchanged through out live of document (until copied) store flags. :d
very dirty business, unprofessional, unreliable , that.
but it's solution. poor one, exists.
i not know fat32 or ntfs file systems support bits flagging except used os. unixes ext family fs's support bits. , should careful in case other important application makes use of them something.
mac os may support metadata itself, not 100% sure.
on windows, have 1 more option associate more data file, wouldn't use well.
well, ntfs file system (fat doesn't support that) has feature called streams.
in essential, same file can have multiple data streams under itself. i.e. have more 1 file contents under same file node.
to more clear. same file contains 2 different files.
when open file main stream visible application. applications must check whether other streams present , choose 1 want follow.
so, may choose store metadata under second stream of file.
but, if streams taken?
even more, anti-virus programs may prevent access metadata out of paranoya, or @ least ask permission. don't know why ms included option, file duplication or something, bad hackers made use of fact can store data, under existing regular file, nobody aware of.
imagine virus writing it's copy stream of 1 of programs there.
all needed start, instead of old program next time run batch script added task scheduler flips 2 streams making virus data main one.
nasty trick! when feature started abused, anti-virus software started restricting files multiple streams, it's feature doesn't exist.
if want add metadata using os's technology, use windows registry, unwise.
what tell you? don't add metadata files, organize separate file, or index data in special files same name file refering , in same folder.
Comments
Post a Comment