Please sign in to comment.
FSStorage: Write to temporary file and do a rename
To avoid a possible issue of serving a partly written file if the Filesystem adapter is used with an existing image (inside a cache adapter in this case), writing the file to a temporary file and then renaming that file to its actually name would make sure we don't end up serving a partly written file. The rename() call is atomic, meaning that there is no time where the contents inside the file we be partly available for anything reading the file.
- Loading branch information...