Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Cache] use copy() instead of rename() on Windows#57663

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:5.4fromxabbuh:issue-50326
Jul 6, 2024

Conversation

@xabbuh
Copy link
Member

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#50326
LicenseMIT

On Windows depending on the PHP versionrename() can fail if the target file is being executed. Since the source file is not used by another process usingcopy() instead should be safe to be used.

On Windows depending on the PHP version rename() can fail if the targetfile is being executed. Since the source file is not used by anotherprocess using copy() instead should be safe to be used.
@nicolas-grekas
Copy link
Member

Thank you@xabbuh.

@nicolas-grekasnicolas-grekas merged commitb437362 intosymfony:5.4Jul 6, 2024
@xabbuhxabbuh deleted the issue-50326 branchJuly 6, 2024 15:01
This was referencedJul 26, 2024
@gggeek
Copy link

I am curious:

  • iscopy an atomic operation on windows? If not, using it is not a very good idea - cache readers might get a half-written version of the file
  • doescopy actually allow to overwrite a file which is being executed?
  • under which scenario would someone be executing a file straight out of the Sf cache? I would think that the cache storage is kind of 'private access'...

@gggeek
Copy link

ps: further thoughts

  • it seems the OP is conflating issues in different systems which have differenr fixes, eg. composer is runningcopy vsunlink as external shell processes
  • the proposed fix for php-src seems at 1st sight better than this. It would not work for all cases where the target file is executed, but at least cover the common scenario of the target file being a php script...

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

4 participants

@xabbuh@nicolas-grekas@gggeek@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp