aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-shim
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe-php-shim')
-rw-r--r--crates/shirabe-php-shim/src/fs.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/shirabe-php-shim/src/fs.rs b/crates/shirabe-php-shim/src/fs.rs
index 9303ad21..ac7a4f99 100644
--- a/crates/shirabe-php-shim/src/fs.rs
+++ b/crates/shirabe-php-shim/src/fs.rs
@@ -22,6 +22,15 @@ pub const PATHINFO_BASENAME: i64 = 2;
pub const PATH_SEPARATOR: &str = ":";
pub const DIRECTORY_SEPARATOR: &str = "/";
+/// PHP `PHP_MAXPATHLEN`: the platform's `MAXPATHLEN` (`MAX_PATH` on Windows).
+pub const PHP_MAXPATHLEN: i64 = if cfg!(windows) {
+ 260
+} else if cfg!(target_os = "linux") {
+ 4096
+} else {
+ 1024
+};
+
pub const FILE_IGNORE_NEW_LINES: i64 = 2;
pub const SEEK_SET: i64 = 0;