Frankly, file creation time is usually fairly useless. When you open
an existing file for write with mode "w", it's not replacing it, it just
opens the existing file and truncates it. Even though the file contents
are completely unrelated to whatever it had on creation, you'd still be
told the file was "created" well before the current version. Conversely,
editors that use atomic replace on save (original file is replaced by new
work-in-progress temp file) would show a more recent creation date, even
if you just deleted one character. Use the modification time, don't grub
for creation time.
So it might make sense to remove the method altogether.
--
Ticket URL: <https://code.djangoproject.com/ticket/27644>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Adam Chainz):
Perhaps `ctime` is good enough though, making the presumption that the
inode attributes only change at creation time?
--
Ticket URL: <https://code.djangoproject.com/ticket/27644#comment:1>
Comment (by Jonathan Verner):
Replying to [comment:1 Adam Chainz]:
> Perhaps `ctime` is good enough though, making the presumption that the
inode attributes only change at creation time?
Unfortunately, that is not the case: `ctime` changes at least as often as
`mtime` does---updating the `mtime` changes inode attributes.
--
Ticket URL: <https://code.djangoproject.com/ticket/27644#comment:2>
* component: File uploads/storage => Documentation
* stage: Unreviewed => Accepted
* type: Bug => Cleanup/optimization
Comment:
Accepting as a documentation clarification for now. I'm not sure if
changing the method's implementation is worth it, but I think it would
require a deprecation path. If you want to pursue that, please raise the
idea on the DevelopersMailingList to get a consensus.
--
Ticket URL: <https://code.djangoproject.com/ticket/27644#comment:3>
* status: new => assigned
* owner: nobody => Ingo Klöcker
Comment:
I'll look into this.
--
Ticket URL: <https://code.djangoproject.com/ticket/27644#comment:4>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/8319 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/27644#comment:5>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/27644#comment:6>
* needs_better_patch: 1 => 0
Comment:
I've improved the patch.
--
Ticket URL: <https://code.djangoproject.com/ticket/27644#comment:7>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"f3ac398dd595c43f551502c742b0b3cbe8440e50" f3ac398d]:
{{{
#!CommitTicketReference repository=""
revision="f3ac398dd595c43f551502c742b0b3cbe8440e50"
Fixed #27644 -- Doc'd FileSystemStorage.get_created_time().
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27644#comment:8>
Comment (by Tim Graham <timograham@…>):
In [changeset:"4678957b4efae23204d954ac912c77d7cf122f26" 4678957b]:
{{{
#!CommitTicketReference repository=""
revision="4678957b4efae23204d954ac912c77d7cf122f26"
[1.11.x] Fixed #27644 -- Doc'd FileSystemStorage.get_created_time().
Backport of f3ac398dd595c43f551502c742b0b3cbe8440e50 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27644#comment:9>