Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX: Filesystem\create_temporary_file(Env\temp_dir())) not equivalent to \tempnam(\sys_get_temp_dir()) #263

Open
bendavies opened this issue Nov 9, 2021 · 3 comments
Assignees
Labels
Status: Available No one has claimed responsibility for resolving this issue. Type: Question A query or seeking clarification on parts of the spec. Probably doesn't need the attention of everyo

Comments

@bendavies
Copy link

bendavies commented Nov 9, 2021

Describe the bug
Not a bug as such, but it caused a failure on my testsuite so thought you might want to know about it:

on OSX (or any system where sys_get_temp_dir() is a symlink: Filesystem\create_temporary_file(Env\temp_dir())) not equivalent to \tempnam(\sys_get_temp_dir()).

Filesystem\create_temporary_file(Env\temp_dir())) will return /var/folders/c9/etc...
\tempnam(\sys_get_temp_dir()) will return /private/var/folders/c9/etc...

because /var/ is a symlink to /private/var

Expected behavior
Not sure really, just FYI.

Environment (please complete the following information):

  • OS: OSX
  • PHP version 8.0
@bendavies bendavies added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Nov 9, 2021
@bendavies bendavies changed the title OSX: Filesystem\create_temporary_file(Env\temp_dir())) not equivalent to `\tempnam(\sys_get_temp_dir()); OSX: Filesystem\create_temporary_file(Env\temp_dir())) not equivalent to \tempnam(\sys_get_temp_dir()) Nov 9, 2021
@azjezz
Copy link
Owner

azjezz commented Nov 9, 2021

so it seems tempnam resolves symlink, while Filesystem\create_temporary_file doesn't.

Not sure if we should 🤔 currently create_temporary_file doesn't use tempnam, and i don't really see a gain from using it.

@azjezz azjezz added Status: Available No one has claimed responsibility for resolving this issue. Type: Question A query or seeking clarification on parts of the spec. Probably doesn't need the attention of everyo and removed Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. labels Nov 9, 2021
@bendavies
Copy link
Author

yep exactly :)

@bendavies
Copy link
Author

could call Filesystem\canonicalize(...) on the result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Available No one has claimed responsibility for resolving this issue. Type: Question A query or seeking clarification on parts of the spec. Probably doesn't need the attention of everyo
Projects
None yet
Development

No branches or pull requests

2 participants