Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Nearly the same, but maybe it helps.</p> <pre><code> #include &lt;Array.au3&gt; ;=============================================================================== ; Function Name.....: _FileGetProperty ; Description.......: Returns a property or all properties for a file. ; Version...........: 1.0.2 ; Change Date.......: 2008-07-28 ; AutoIt Version....: 3.2.12.1 ; ; Parameter(s)......: $S_PATH - String containing the file path to return the property from. ; $S_PROPERTY - [optional] String containing the name of the property to return. (default = "") ; Requirements(s)...: None ; Return Value(s)...: Success: Returns a string containing the property value. ; If $S_PROPERTY is empty, an two-dimensional array is returned: ; $av_array[0][0] = Number of properties. ; $av_array[1][0] = 1st property name. ; $as_array[1][1] = 1st property value. ; $av_array[n][0] = nth property name. ; $as_array[n][1] = nth property value. ; Failure: Returns 0 and sets @error to: ; 1 = The folder $S_PATH does not exist. ; 2 = The property $S_PROPERTY does not exist or the array could not be created. ; 3 = Unable to create the "Shell.Application" object $objShell. ; ; Author(s).........: - Simucal &lt;Simucal@gmail.com&gt; ; - Modified by: Sean Hart &lt;autoit@hartmail.ca&gt; ; - Modified by: teh_hahn &lt;sPiTsHiT@gmx.de&gt; ; Company...........: None ; URL...............: None ; Note(s)...........: None ;=============================================================================== Global $re = _FileGetProperty(@ScriptDir &amp; '\1Tutorial - AutoItWiki1.pdf') If @error Then MsgBox(16, 'ERROR', 'Error: ' &amp; @error &amp; @CRLF &amp; '1 = The folder $S_PATH does not exist.' &amp; @CRLF &amp; _ '2 = The property $S_PROPERTY does not exist or the array could not be created.' &amp; @CRLF &amp; _ '3 = Unable to create the "Shell.Application" object $objShell.') _ArrayDisplay($re) Func _FileGetProperty(Const $S_PATH, Const $S_PROPERTY = "") If Not FileExists($S_PATH) Then Return SetError(1, 0, 0) Local Const $S_FILE = StringTrimLeft($S_PATH, StringInStr($S_PATH, "\", 0, -1)) Local Const $S_DIR = StringTrimRight($S_PATH, StringLen($S_FILE) + 1) Local Const $objShell = ObjCreate("Shell.Application") If @error Then Return SetError(3, 0, 0) Local Const $objFolder = $objShell.NameSpace($S_DIR) Local Const $objFolderItem = $objFolder.Parsename($S_FILE) If $S_PROPERTY Then For $i = 0 To 99 If $objFolder.GetDetailsOf($objFolder.Items, $i) = $S_PROPERTY Then Return $objFolder.GetDetailsOf($objFolderItem, $i) Next Return SetError(2, 0, 0) EndIf Local $av_ret[1][2] = [[1]] For $i = 0 To 99 If $objFolder.GetDetailsOf($objFolder.Items, $i) Then ReDim $av_ret[$av_ret[0][0] + 1][2] $av_ret[$av_ret[0][0]][0] = $objFolder.GetDetailsOf($objFolder.Items, $i) $av_ret[$av_ret[0][0]][1] = $objFolder.GetDetailsOf($objFolderItem, $i) $av_ret[0][0] += 1 EndIf Next If Not $av_ret[1][0] Then Return SetError(2, 0, 0) $av_ret[0][0] -= 1 Return $av_ret EndFunc ;==&gt;_FileGetProperty </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload