Jump to content
chkaufmann

IOUtils.pas vs. SysUtils.pas

Recommended Posts

Since some years there is the unit IOUtils.pas. There are many duplicated functions:

 

ExtractFileExt()   -   TPath.GetExtension()

ExtractFileName() - TPath.GetFileName()

FileAge()  - TFile.GetLastWriteTime()

 

My code uses SysUtils.pas in most places, and I'm not sure if I should change this to use the functions from the new unit IOUtils.pas because the others will be deprecated at some point? And is there a comparisation table anywhere? It looks like not all functions work exactly the same way especially when it comes to throw exceptions.

 

Christian

Share this post


Link to post

I think that initially the unit System.IOUtils.pas was created to provide platform-safe functions (windows, mac, android etc). Now I see many IFDEFs even in SysUtils...

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×