PHP code example of kherge / file

1. Go to this page and download the library: Download kherge/file library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kherge / file example snippets


use KHerGe\File\File;

$file = new File('example.txt');
$file->fseek(-1);

/* 
 * Fatal error: Uncaught exception 'KHerGe\File\Exception\FileException' with message 'The file "test.txt" could not be seeked.' in /path/to/file/src/lib/KHerGe/File/Exception/FileException.php on line 157
 *
 * KHerGe\File\Exception\FileException: The file "test.txt" could not be seeked. in /path/to/file/src/lib/KHerGe/File/Exception/FileException.php on line 157
 *
 * Call Stack:
 *     0.0001     248992   1. {main}() /path/to/file/test.php:0
 *     0.0011     382928   2. KHerGe\File\File->fseek() /path/to/file/test.php:6
 */