Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
fsutil file createnew [filename] [filesize in bytes]
fsutil file createnew C:\xampp\htdocs\mytest\data.dat 10737418240
<?php
$filesystem = new COM('Scripting.FileSystemObject');
$file = $filesystem->GetFile('C:\xampp\htdocs\mytest\data_10gb.dat');
$size = $file->Size();
var_dump($size);
?>
function mygetSize($file)
{
$fileName = basename($file);
$cmd = exec("dir /-c " . escapeshellarg($file), $out, $err);
$pattern = "/(.*?)$fileName\$/";
$size = 0;
foreach($out as $line)
{
if(preg_match($pattern, $line, $matches))
{
$match = trim($matches[1]);
$parts = explode(' ',$match);
$size = $parts[count($parts)-1];
}
}
return $size;
}
function mygetSize($file)
{
$exists = file_exists($file);
if(!$exists)
{
die("File $file not found");
}
$fileName = basename($file);
$cmd = exec("dir /-c " . escapeshellarg($file), $out, $err);
if($err != 0)
{
die("Getting file info using dir command failed with error code $err");
}
// Debugging
//var_dump($out);
$pattern = "/(.*?)$fileName\$/";
$size = 0;
foreach($out as $line)
{
if(preg_match($pattern, $line, $matches))
{
$match = trim($matches[1]);
$parts = explode(' ',$match);
// Debugging
//var_dump($parts);
$size = $parts[count($parts)-1];
}
}
return $size;
}