php / php/php-src

Add function to return file/folder creation time

Open
#14,890 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Extension: standard Feature Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

Currently there is no way of getting the creation time of a folder ("Birth" when using stat) without using a command like:

shell_exec('stat -c %W .')
  File: .
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: fd00h/64768d    Inode: 135399518   Links: 3
Access: (0775/drwxrwxr-x)  Uid: ( 1004/acceptpo)   Gid: ( 1005/acceptpo)
Access: 2024-07-09 16:32:26.402709986 +0200
Modify: 2024-07-09 16:32:31.806815720 +0200
Change: 2024-07-09 16:32:31.806815720 +0200
 Birth: 2023-10-05 11:02:30.038341914 +0200

It would be nice to have a function for that.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the shell_exec('stat -c %W .') example and the Linux stat output, then compare the requested birth time for files and folders with PHP's current filesystem behavior. Done means the API's supported behavior is defined and tests cover creation times for both files and directories.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, php
Domain
backend, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.