Delphi cross-platform system utilities for system file functions [on hold]


I am migrating a Delphi 10.3 VCL application to Firemonkey. The units that do not use the GUI compile without any modification except for those which use the Windows-specific system functions mentioned below.

Can anyone point me to cross-platform system file utilities in Delphi/Firemonkey 10.3, or alternative workarounds, to carry out the following actions needed to complete my project:

Extract the system icon for a file or application on the basis of its extension or MIME type
Execute a system shell command, e.g. to open a file (equivalent to WinAPI ShellExecute)
Launch an external program in a child process and wait for its termination (e.g. create a child process using WinAPI CreateProcess and wait using WaitForSingleObject)
Get/set a file’s TimeCreated, TimeModified, & TimeAccessed timestamps so that a file copy may be made having the same timestamps as the source file.

I have Googled for these but the hits I have seen only refer to Windows functions. Some hits indicate that Free Pascal provides a TProcess class and ExecuteProcess(), RunCommand(), and OpenDocument() procedures that are described as being cross-platform.

Regarding the timestamps, it is possible to obtain these using the FindFirst and FindNext functions and then reading timestamps in the TSearchRec returned. But I didn’t find how to set the timestamps in the FMX version, which I did in the VCL version using relevant Win API functions.

I am not asking for opinions or recommendations about the best out of a number of possible options, but for a factual answer to a specific question about Delphi 10.3’s cross-platform support for basic system functions that one would expect to find in any mature GUI OS, such as Windows and Unix-based OS’s. I searched for the an answer in the Delphi help system and on Google without success before posting the question on Stackoverflow. The first answer in this thread does just that. That I appreciate.

Comments are closed.