aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/filesystem.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-03 20:10:17 +0900
committernsfisis <nsfisis@gmail.com>2026-06-03 20:10:17 +0900
commiteacd2abcc53659a9fa20b1274a30ac4d9ad8bdb6 (patch)
tree22affc2abef924f4f8bbe7ccec920689c9c01783 /crates/shirabe/src/util/filesystem.rs
parent26daafaae3713cd94ce32354e6404d95e06c568c (diff)
downloadphp-shirabe-eacd2abcc53659a9fa20b1274a30ac4d9ad8bdb6.tar.gz
php-shirabe-eacd2abcc53659a9fa20b1274a30ac4d9ad8bdb6.tar.zst
php-shirabe-eacd2abcc53659a9fa20b1274a30ac4d9ad8bdb6.zip
feat(php-shim): align fwrite/touch2/PHP_OS_FAMILY/PHP_URL_SCHEME with PHP
Adjust fwrite to return int|false equivalent (Option<i64>), add touch2 with mtime, implement PHP_OS_FAMILY via std::env::consts::OS, and swap the PHP_URL_HOST placeholders for the now-available PHP_URL_SCHEME. Wire these into locker, filesystem, platform, and remote_filesystem. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/util/filesystem.rs')
-rw-r--r--crates/shirabe/src/util/filesystem.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/shirabe/src/util/filesystem.rs b/crates/shirabe/src/util/filesystem.rs
index ef3d307..c7f3583 100644
--- a/crates/shirabe/src/util/filesystem.rs
+++ b/crates/shirabe/src/util/filesystem.rs
@@ -405,9 +405,9 @@ impl Filesystem {
while !feof(source_handle.clone()) {
let chunk =
fread(source_handle.clone(), 1024 * 1024).unwrap_or_default();
- // TODO(phase-b): PHP fwrite returns int|false; shim currently returns ();
- // assume success here.
- fwrite(target_handle.clone(), &chunk, chunk.len() as i64);
+ if fwrite(target_handle.clone(), &chunk, chunk.len() as i64).is_none() {
+ return Err(e.into());
+ }
}
fclose(source_handle);
fclose(target_handle);