You are here

public function vfsStreamFile::openWithTruncate in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamFile.php \org\bovigo\vfs\vfsStreamFile::openWithTruncate()

open file and truncate content

@since 0.9

File

vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamFile.php, line 149

Class

vfsStreamFile
File container.

Namespace

org\bovigo\vfs

Code

public function openWithTruncate() {
  $this
    ->open();
  $this->content
    ->truncate(0);
  $time = time();
  $this->lastAccessed = $time;
  $this->lastModified = $time;
}