struct stat st;
if (stat (path &st) == 0) x = st.st_size;
program xx
implicit none
character(len=256) :: message
character(len=4096) :: filename
integer :: ios,x
logical :: foundit
filename='myfile'
inquire(file=filename,exist=foundit,size=x,iostat=ios,iomsg=message)
if(.not.foundit)then
write(*,*)'file ',trim(filename),' not found'
elseif(ios.ne.0)then
write(*,*)trim(message)
else
write(*,*)'size =',x,'bytes'
endif
end program xx
long x = new File(path).length();
X : constant File_Size := Size (Path);
struct stat st; if (stat (path &st) == 0) x = st.st_size;
FILE *f = fopen(path, "rb"); fseek(f, 0, SEEK_END); int x = ftell(f); fclose(f);
std::ifstream f(path, std::ios::in | std::ios::binary); f.seekg(0, std::ios::end); size_t x = f.tellg();
var filePath = "Sample.txt"; var fileInfo = new FileInfo(filePath); var _x = fileInfo.Length;
long? FileSize(string path) { if (!File.Exists(path)) { return null; } return (new FileInfo(filePath)).Length; }
auto x = getSize(path);
var x = File(path).lengthSync();
final x = (await File(path).readAsBytes()).length;
def main(path) do _x = path |> File.stat!() |> Map.get(:size) end
program xx implicit none character(len=256) :: message character(len=4096) :: filename integer :: ios,x logical :: foundit filename='myfile' inquire(file=filename,exist=foundit,size=x,iostat=ios,iomsg=message) if(.not.foundit)then write(*,*)'file ',trim(filename),' not found' elseif(ios.ne.0)then write(*,*)trim(message) else write(*,*)'size =',x,'bytes' endif end program xx
info, err := os.Stat(path) if err != nil { return err } x := info.Size()
filesize = withFile path ReadMode hFileSize
let x = read(path).length
(defvar x (osicat-posix:stat-size (osicat-posix:stat #P"path")))
$x = filesize($path);
x := filesize(path);
my $x = -s $path;
x = os.path.getsize(path)
x = File.size(path)
let x = path.metadata()?.len();
let x = fs::metadata(path)?.len();
let x = fs::metadata(path)?.st_size();