Skip to content

Keep timestamps of copied assets #1113

Open
@sluedecke

Description

@sluedecke

My use case is a static website with quite some assets. The upload mechanism compares file timestamps to check which files have been updated.

Currently assets are copied over to the destination and get a fresh timestamp with each build. Thus my upload mechanism always wants to upload the whole site, even if I have changed only some pages.

So the feature request is for src/cobalt_model/files.rs, where around line 281 fs::copy is used, to also set the timestamp for the target file.

This crate could help: https://crates.io/crates/filetime, esp. the routine filetime::set_file_mtime.

Here is some code which could be used as an example: https://github.com/mtkennerly/ludusavi/blob/e0d16ca4aa6aafad8caebd648c242ac32c2cdae4/src/path.rs#L334

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions