# AG\_FILESTATS _Reviewed and revised December 2023_ **tab(-10, AG\_FILESTATS); fspec \{,versiz, hashsiz, flags\}; chr(127);** [Tab(-10,x) Syntax Notes](ag_xxx_syntax-notes.md) AG\_FILESTATS (31) allows you to retrieve info about a file. This function has both a [subroutine and a print tab implementation](subroutine-print-pairs.md). **Parameters** _versiz, hashsiz _ these are numeric values representing the size of the strings you intend to retrieve them into. If 0 or not specified, then the corresponding field will not be returned. Set versiz=30 to get the #####.#####.#####.#####.##### format; see [MX\_FILESTATS](mx_filestats.md)[xs](keyword-types.md). _flags_ may contain one or more of the following: | **Value** | **Description** | |------|------| | \&h0001 | Check for fspec in ATE cache directories if not found otherwise | | \&h0002 | Returned client native spec of located file | | \&h0004 | Request return of last access time | **Response** The return string is of the format: _bytes, mtime, ctime, mode \{,ver, hash, pcspec, atime\}_ CR **Example** .AGCMD AG\_FILESTATS,"%ATE%\\dsk0\\007006\\csv2xl.sbx",16,30,7 Response is: 122656,1696396569,1455643406,33206,2.2.0.291,376-212-504-153,,1701566017 This example illustrates the AGCMD.LIT utility which allows you to send AG\_xxx functions (by name, internally using the TAB(-10,...) syntax shown at the top of this topic) and see the response, without writing any code. The downside is that the response (in this case) is somewhat hard to read due to the large encoded values for the mtime, ctime, mode and atime fields, but it does make clear exactly what response the program will see. **Comments** [MX\_FILESTATS](mx_filestats.md)[xs](keyword-types.md) is generally used in preference to AG\_FILESTATS, because it is easier to use (standard subroutine return values), and works in all the same cases (including ATE), with the one exception that it requires A-Shell on the server. AG\_FILESTATS could be used on any kind of server. The _pcspec_ is only returned in the case where the _fspec_ is not fully qualified and the _flags_ \&h0002 bit is set causing the routine to locate the file in one of the cache directories. Note that all fields are comma delimited up to the last non-blank field. **See Also** • [MX\_FILESTATS](mx_filestats.md)[xs](keyword-types.md) **History** 2023 August, A-Shell 6.5.1740: Add _atime_ parameter, last access time 2011 June, A-Shell 5.1.1222: Add _flags_ parameter, reformat return string