A couple of months ago I posted this about how to store data and metadata read in from standardized instrument files and reports. We’re thinking about going with the option of storing the file header data in temporary files and having a ingest_header() function to read them back in. Our current plan is for the files to go into tempdir() with a name that is a sha1 has of the full file name with any non-alphanumeric characters replaced with ‘_’. This should make sure we avoid any special characters (’=’) from the hash, and hashing should make sure we avoid any character number limits on the filename imposed by different OSes.
Does anyone have any advice or pitfalls about using tempdir() like this? We couldn’t think of any other use cases that posed problems for the approach, but we would rather incorporate them now from the beginning rather than start from scratch.