An alternative is to use fileinfo@ which works as shown below.
program test_inquire_size
implicit none
character(260) :: path
integer(2) :: mode, dev, rdev, nlink, err
integer(3) :: size, atime, mtime, ctime
logical :: fexists
path = 'freeformat1.f95'
inquire(file=path, exist=fexists)
if (.not. fexists) then
print *, 'File does not exist.'
stop
end if
call fileinfo@(trim(path)//char(0), mode, dev, rdev, nlink, size, atime, mtime, ctime, err)
if (err .eq. 0) then
print *, 'File exists:', fexists
print *, 'File size (bytes):', size
print *, 'Access time:', atime
print *, 'Modified time:', mtime
print *, 'Creation time:', ctime
else
print *, 'Error reading file info. Error code:', err
end if
end program
File exists: T
File size (bytes): 800
Access time: 1762769130
Modified time: 1762769130
Creation time: 1760533762
C:\Arcadis 2025\0008