Skip to content

Make sure resizetized image files are writable#23412

Merged
rmarinho merged 1 commit into
dotnet:mainfrom
dellis1972:Issue23397
Jul 15, 2024
Merged

Make sure resizetized image files are writable#23412
rmarinho merged 1 commit into
dotnet:mainfrom
dellis1972:Issue23397

Conversation

@dellis1972

@dellis1972 dellis1972 commented Jul 3, 2024

Copy link
Copy Markdown
Contributor

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.

@dellis1972 dellis1972 requested a review from a team as a code owner July 3, 2024 07:43
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
Copy Markdown
Contributor Author

@mattleibow any chance of a review on this one?

@dellis1972 dellis1972 requested a review from mattleibow July 12, 2024 08:00
@rmarinho rmarinho merged commit dfa68e0 into dotnet:main Jul 15, 2024
@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