Thanks as always to Kit Baum, a new package osgen is now available for download from SSC. In Stata, use the ssc command to do this.

The osgen package is described as below on my webste, and is intended for use in output datasets (or resultssets) produced using the xdir package, to generrate OS statistics for files using the new Stata 16 python interface. I would like to thank Rafal Raciborski of StataCorp for the tip about using Python, and Zhao Xu of StataCorp for the help with Python installation. And, of course, all at StataCorp for the impressive Stata 16 python interface.

Best wishes

Roger

--------------------------------------------------------------------------------------------------
package osgen from http://www.rogernewsonresources.org.uk/stata16
--------------------------------------------------------------------------------------------------

TITLE
osgen: Add Python os_stat() file attributes to a xdir resultsset

DESCRIPTION/AUTHOR(S)
osgen is intended for use in output datasets (or resultssets)
produced by the xdir module of the xdir package, which have one
observation for each of a list of files, and data on directory names
and file names. It inputs the file name variable and (optionally)
the directory name variable, and generates a list of new variables,
containing, in each observation, Python os_stat() attributes of the
corresponding file, as recognised by the current operating system
(OS). These attributes include file sizes and creation,
modification and access times. The storage conventions for these OS
statistics for files may vary between operating environments, but it
might still be useful to be able to sort the extended xdir
resultsset by these attributes. This package uses the Stata Python
interface, and requires the presence, in the user's operating
environment, of a version of Python compatible with the user's
version of Stata.

Author: Roger Newson
Distribution-Date: 14september2020
Stata-Version: 16

INSTALLATION FILES (click here to install)
osgen.ado
osgen.sthlp
--------------------------------------------------------------------------------------------------
(click here to return to the previous screen)