ktlim
ktlim

Reputation: 249

reading file metadata using lua

I wonder if there is a better code/library that would allow reading the file metadata?

So far, I have tried using LuaFileSystem and LuaCom (Scripting.FileSystemObject) but so far none was able to extract all the data. When I mean all the data, other than the usual standard data such as date accessed, date created, date modified, etc, I wanted some more data like in the case for pdf, it will contain other data such as author and title and for image, it will contain data like bit depth, resolution.

Upvotes: 1

Views: 1483

Answers (1)

Nicol Bolas
Nicol Bolas

Reputation: 473437

You seem to be missing the difference between filesystem metadata and document metadata. Filesystem metadata is the metadata the filesystem stores about a file. Every file has this stuff, because every file is stored on the filesystem. This metadata is not actually stored within the file; if you loaded the file, that wouldn't give you access to the filesystem metadata. You have to talk to the filesystem to get it.

Document metadata is some bit of information within the file that serves as metadata. To get this data you have to read the file, know what the file's format is, and parse that metadata out.

I don't know of any library, Lua or otherwise, that is designed to extract arbitrary metadata from arbitrary file types.

Upvotes: 5

Related Questions