-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathFileSystemInterface.php
More file actions
53 lines (47 loc) · 1.33 KB
/
FileSystemInterface.php
File metadata and controls
53 lines (47 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace PiPHP\GPIO\FileSystem;
interface FileSystemInterface
{
/**
* Checks whether a file or directory exists
*
* @param string $path Path to the file or directory
*
* @return bool true if file exists, false otherwise
*/
public function exists(string $path): bool;
/**
* Tells whether the filename is a directory
*
* @param string $path Path to the file/directory
*
* @return bool true if the filename exists and is a directory, false otherwise
*/
public function isDir(string $path): bool;
/**
* Open a file.
*
* @param string $path The path of the file to open
* @param string $mode The mode to open the file in (see fopen())
*
* @return resource A stream resource.
*/
public function open(string $path, string $mode);
/**
* Read the contents of a file.
*
* @param string $path The path of the file to read
*
* @return string The file contents
*/
public function getContents(string $path): string;
/**
* Write a buffer to a file.
*
* @param string $path The path of the file to write to
* @param string $buffer The buffer to write
*
* @return int The number of bytes written
*/
public function putContents(string $path, string $buffer): int;
}