Skip to content

File creation timestamp#17

Merged
icppWorld merged 4 commits intomainfrom
file-creation-timestamp
Jul 23, 2025
Merged

File creation timestamp#17
icppWorld merged 4 commits intomainfrom
file-creation-timestamp

Conversation

@icppWorld
Copy link
Contributor

Endpoint to get file creation timestamp & age of a file (or directory) in the canister

Adds a new query endpoint to retrieve the file creation timestamp in nanoseconds and its age in seconds.
@icppWorld icppWorld requested a review from Copilot July 23, 2025 17:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new endpoint get_creation_timestamp_ns to retrieve file creation timestamps and age information for files in the canister. The implementation provides both timestamp in nanoseconds and age in seconds for existing files.

  • Adds new API endpoint get_creation_timestamp_ns for querying file creation timestamps
  • Updates error handling to use consistent error response format across file operations
  • Refactors helper function location from utils to files module for better organization

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/llama_cpp.did Adds new API types and service definition for timestamp functionality
src/files.h Declares new endpoint function and moves helper function from utils
src/files.cpp Implements timestamp retrieval logic and updates error handling
test/test_files.py Adds comprehensive test coverage for the new endpoint
src/utils.h Removes helper function declaration (moved to files.h)
src/utils.cpp Removes helper function implementation (moved to files.cpp)
src/db_chats.cpp Adds include for files.h
native/test_files.cpp Updates expected response format for existing test
README.md Updates documentation with new endpoint usage examples

@icppWorld icppWorld merged commit 9bfc11b into main Jul 23, 2025
1 check passed
@icppWorld icppWorld deleted the file-creation-timestamp branch July 23, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant