Skip to content

unable to add_chunk to existing file in Mojo::Asset::File #1870

Answered by jhthorsen
s1037989 asked this question in Q&A
Discussion options

You must be logged in to vote

Your "add_chunk()" code can be written as path($file)->open('>>')->syswrite($content).

You'll get that error message from Mojo::Asset::File when operating on existing files. I think Mojo::Asset::File is only designed to modify files if it's initialized with non-existing files. This makes sense when the webserver receives a huge body, where you the content is "new", but could be moved to a non-temporary location.

https://github.com/mojolicious/mojo/blob/main/lib/Mojo/Asset/File.pm#L15

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by s1037989
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants