Skip to content

..cache_rds: not platform agnostic.. #100

@lenz99

Description

@lenz99

Dear Yihui,
I appreciate xfun's straightforward caching function cache_rds.
Today, however, I realised that there is a hidden platform dependency because the hash is calculated using MD5 on objects that are first written out as RDS files. In my concrete case, I have a list of objects that serves as a hash. Saving this list as RDS gives different file objects on Mac and Linux (due to locale settings that might differ). Hence, the caching erroneously fails when I switch from one platform to the other.

My question:
Is it possible to avoid saving the hash objects as RDS-files to disk within cache_rds (i.e., within md5_obj) because it can make the caching platform dependent?

I have thought about something in the line of rlang::hash which operates directly on R-objects (using only RAM).

Thanks!
-m

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions