Skip to content

Commit

Permalink
blob/fileblob: Add docstring about tempdirs
Browse files Browse the repository at this point in the history
  • Loading branch information
vangent committed Aug 3, 2023
1 parent 9b62f46 commit 0cac84d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions blob/fileblob/fileblob.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
// Package fileblob provides a blob implementation that uses the filesystem.
// Use OpenBucket to construct a *blob.Bucket.
//
// To avoid partial writes, fileblob writes to a temporary file and then renames
// the temporary file to the final path on Close. By default, it creates these
// temporary files in `os.TempDir`. If `os.TempDir` is on a different mount than
// your base bucket path, the `os.Rename` will fail with `invalid cross-device link`.
// To avoid this, either:
// a) Configure the temp dir to use by setting the environment variable `TMPDIR`.
// b) Set `Options.NoTempDir` to `true`; fileblob will create the temporary files
// next to the actual files instead of in a temporary directory. Note that
// this may result in stranded temporary files.
//
// By default fileblob stores blob metadata in 'sidecar files' under the original
// filename but an additional ".attrs" suffix.
// That behaviour can be changed via Options.Metadata;
Expand Down

0 comments on commit 0cac84d

Please sign in to comment.