Now we have a customer request that when we use a particular file for
processing in an automation environment we should write to the comment
the timestamp of usage and some identifying string as well.
He will then use Windows Explorer with the Comment field enabled in
the right-hand pane (Detail view) to see which files have been used
and when.
It is not possible to modify the file contents itself because then it
gets unusable in the main application. Mostly the files in question
are program files for machine tools.
I guess that the "Comment" is some kind of NTFS metadata and now I
would like to know if it is possible to programmatically edit this
info using Delphi 7??
/BoB
> I guess that the "Comment" is some kind of NTFS metadata
Yes, it is. Specifically, it is part of the "Summary Information Property
Set" stream:
http://msdn.microsoft.com/en-us/library/aa380376(VS.85).aspx
> I would like to know if it is possible to programmatically edit this
> info using Delphi 7??
Yes, but there are several steps involved to reach it. Read the following
chaptre of MSDN for more details:
Structured Storage
http://msdn.microsoft.com/en-us/library/aa380369(VS.85).aspx
In a nutshell, you will need to use the StdCreateStorage/Ex() and/or
StdOpenStorage/Ex() function to retreive an IPropertySetStorage interface,
and then you can use that to update the Summary information as needed.
Gambit
I guess that should have been StgCreateStorage/Ex() and/or
StgOpenStorage/Ex(). Anyway, quite interesting...
--
Jens Gruschel
http://www.pegtop.net