HaxeFoundation / HaxeFoundation/haxe

[PHP, PHP7] sys.FileSystem.exists inconsistent with Neko when path to a file has trailing slash

Open
#6,592 2 comments 0 reactions 1 assignee Claimed by @RealyUniqueName View on GitHub
feature-filesystem platform-php
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

If an actual file `/tmp/some.file` (not directory) exists and following code is run
```
trace(sys.FileSystem.exists("/tmp/some.file")); // Neko: true, PHP/PHP7: true
trace(sys.FileSystem.exists("/tmp/some.file/")); // Neko: true, PHP/PHP7: false
```
thus requiring to use `sys.io.Path.normalize` before using this function on PHP target.

Don't know if it should be treated as a bug but this inconsistence between targets should at least be mentioned in the docs (probably as well as a fact that calls to that function are cached by PHP).

Didn't check with other targets (seems specific to PHP though).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.