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);
X : constant File_Size := Size (Path);
std::ifstream f(path, std::ios::in | std::ios::binary);
f.seekg(0, std::ios::end);
size_t x = f.tellg();
long? FileSize(string path) {
if (!File.Exists(path)) {
return null;
}
return (new FileInfo(filePath)).Length;
}
var filePath = "Sample.txt";
var fileInfo = new FileInfo(filePath);
var _x = fileInfo.Length;
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
long x = new File(path).length();
(defvar x (osicat-posix:stat-size (osicat-posix:stat #P"path")))
x = os.path.getsize(path)
let x = path.metadata()?.len();
let x = fs::metadata(path)?.len();
let x = fs::metadata(path)?.st_size();