Results 1 to 7 of 7
  1. #1

    Obaining File Properties

    What I am trying to do is obtain the digital signiture and detailed version info that is typcially displayed when viewing the properties of a file.

    I have been going through some of the past postings and believe that I can use the GetFileAttributes or GetFileAttributesEx fucntion available in the kernel32 dll. I have put together a function that succesfully uses this and returns a value, but I am not sure what to do with the returned DWORD value. According to the MSDN site it "contains the attributes of the specified file", but DWORD is declared as an UNSIGNED LONG in mswtype.inc, so when I print it out all I get is a numerical value.

    Can anyone offer some help in retrieving the file properties from this function, or maybe point me in the right direction if this is not it.


  2. #2
    Senior Member
    Join Date
    Aug 2004
    Dublin, Ireland

    Re: Obaining File Properties

    The numeric values are the attributes.. as follow ( values are be added together to get multiple attribute )

  3. #3

    Re: Obaining File Properties

    After some investigation...

    As far as acquiring file attribute values, it is much easier to get this through the SYS_GetDirContents function. It returns a list of FILEINFO for all files in the specified directory, which you can search through, find the file you want, then test for attributes. There is a blurb under the help item "FILEINFO datatype" about how to acquire this information.

    In regards to file version information, I attmpted to implement this through the GetFileVersionInfo and GetFileVersionInfoSize functions defined in the version.dll. However I ran into trouble with GetFileVersionInfo and passing an array data type into the external function. I believe another member stated this was impossible with SilkTest in another posting. The solution I came to was to define a funciton in C++ that took only string arguments, then wrap this up in another dll.

    In regards to digital signature, no solution found there. I guess I will try and implement some function that will bring up the windows file properties and read the values directly from the window. If anyone has a better idea on capturing this information I am all ears.

  4. #4

    Re: Obaining File Properties

    There's a file tools library here. There's a GetAttributes function in there that will help.

  5. #5

    Re: Obaining File Properties

    I just tried this tool, but got jebbrish data...
    So my guess this tool has not been updated since a while.

    Do we have any other way to get the file version?
    I read about version.dll call.... but I am not familiar with dll calls and SILK...

    help would be appreciated

  6. #6

    Re: Obaining File Properties

    read help file provided with silk test. it should have a topic on dlls

    the general syntax is:
    <font class="small">Code:</font><hr /><pre>
    dll "&lt;full path to dll&gt;.dll"
    &lt;list function names here&gt;
    </pre><hr />

    hope this helps.


  7. #7

    Re: Obaining File Properties

    Function works....To determine a file attribute, you must use a binary AND comparison with the file attribute. If the comparison returns that same file attribute, then the attribute exists.

    attributes are as follows:
    [-] type ATTRIB is enum
    [ ] FA_ARCHIVE = 0x20
    [ ] FA_COMPRESSED = 0x800
    [ ] FA_DIRECTORY = 0x10
    [ ] FA_HIDDEN = 0x2
    [ ] FA_NORMAL = 0x80
    [ ] FA_READONLY = 0x1
    [ ] FA_SYSTEM = 0x4
    [ ] FA_TEMPORARY = 0x100



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:16 PM.

Copyright BetaSoft Inc.