Crystal: Proposal: Rename File::Stat to FileInfo

Created on 3 Jan 2017  路  3Comments  路  Source: crystal-lang/crystal

Crystal is moving to be supported in non posix plataforms (#3582). But some of the standard library api have posixisms in place, and my proposal is to remove some of them.

File::Stat represents information about a file and I think it would be best if it was designed to represent this concept and not simply be a direct copy of posix names. Today you do: File.lstat("foo").mtime and it could be: File.info("foo", follow_links: false).modification_time. Qt does a similar thing: QFileInfo.

(Probably there will be more proposals like this)

implemented stdlib

Most helpful comment

Perhaps File::Info suits better? (following the idea of avoid repeating the parent namespace word).

In the case of modification_time, perhaps modified_time fits better, since is a bit shorter :wink:

All 3 comments

Perhaps File::Info suits better? (following the idea of avoid repeating the parent namespace word).

In the case of modification_time, perhaps modified_time fits better, since is a bit shorter :wink:

include File::Info
File.new("foo").mtime

I think this is better 馃槃

I think is solved in #5584

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pbrusco picture pbrusco  路  3Comments

TechMagister picture TechMagister  路  3Comments

ArthurZ picture ArthurZ  路  3Comments

nabeelomer picture nabeelomer  路  3Comments

Sija picture Sija  路  3Comments