Skip to content

Missing File::Info data. #8357

Open
Open
@didactic-drunk

Description

@didactic-drunk

Crystal::System::FileInfo is missing public accessors. I'd like to create a PR to expose some or all of the information below.

Most of the data is cross platform with some exceptions. The list is not exhaustive.

Name Platforms Notes
atime POSIX, Windows
ctime POSIX, Windows
birth_time Dragonfly, FreeBSD, Linux, MacOS, Windows
ino POSIX, Windows*
dev POSIX, ? Is the volume serial number on Windows equivalent?
nlink POSIX, Windows
blocks POSIX Not technically required in the spec but implemented almost universally.
blksize POSIX Not technically required in the spec but implemented almost universally.
flags Linux, *BSD, MacOS, ?

Suggested names:

  • access_time or last_access_time.
  • creation_time or birth_time.
  • change_time or metadata_change_time.
  • link_count.
  • io_block_size.
  • flags is used by something else. I don't know what to call it.

Currently I need ctime, birth_time, ino, dev, nlink, flags. I assume others may want the full stat structure when more non web applications are written.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions