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

Make sure resizetized image files are writable #23412

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

dellis1972
Copy link
Contributor

@dellis1972 dellis1972 commented Jul 3, 2024

Fixes #23397

Commit ff5f3f0 added code which "touches" a file
to make sure its LastWrite time is up to date. This was to help solve certain build issues.

However there was an oversight. Certain source control systems always check out files readonly. In these cases the file attributes are copied when we make a copy of a file to be resizetized. When that happens we end up with the following error.

Access to the path 'Debug\net8.0-android\resizetizer\r\drawable\foo.png' is denied.

To fix this lets make sure that the file is writable before we try to update it.

Also fix some formatting to make sure it matches.

Fixes dotnet#23397

Commit ff5f3f0 added code which "touches" a file
to make sure its LastWrite time is up to date. This
was to help solve certain build issues.

However there was an oversight. Certain source control
systems always check out files `readonly`. In these
cases the file attributes are copied when we make a
copy of a file to be resizetized. When that happens
we end up with the following error.

```
Access to the path 'Debug\net8.0-android\resizetizer\r\drawable\foo.png' is denied.
```

To fix this lets make sure that the file is writable before
we try to update it.

Also fix some formatting to make sure it matches.
@dellis1972
Copy link
Contributor Author

@mattleibow any chance of a review on this one?

@rmarinho rmarinho merged commit dfa68e0 into dotnet:main Jul 15, 2024
97 checks passed
@dellis1972 dellis1972 deleted the Issue23397 branch July 15, 2024 12:08
@samhouts samhouts added fixed-in-net9.0-nightly This may be available in a nightly release! fixed-in-net8.0-nightly This may be available in a nightly release! fixed-in-8.0.80 and removed fixed-in-net9.0-nightly This may be available in a nightly release! fixed-in-net8.0-nightly This may be available in a nightly release! labels Aug 2, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed-in-8.0.80 fixed-in-net9.0-nightly This may be available in a nightly release!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resizetizer file access issues on Windows build in Visual Studio
4 participants