A code starting at line 2195 shows the appropriate style of trash info:
{
time_t t;
struct tm now;
t = time (NULL);
localtime_r (&t, &now);
delete_time[0] = 0;
strftime(delete_time, sizeof (delete_time), "%Y-%m-%dT%H:%M:%S", &now);
}
data = g_strdup_printf ("[Trash Info]\nPath=%s\nDeletionDate=%s\n",
original_name_escaped, delete_time);
As for the second change, a comment starting at line 2181 is helpful. This comment and discussion ( https://bugzilla.gnome.org/show_bug.cgi?id=749314 ) shows the appropriate order of moveFile and writeFile.
/* Write the full content of the info file before trashing to make
* sure someone doesn't read an empty file. See #749314
*/
I confirmed that the fixed code worked fine in Ubuntu 18.04. When I reverse the order of moveFile and writeFile in js, I always reproduce the hashed filename issue.
IssueHunt Summary
### Referenced issues
This pull request has been submitted to:
- [#56: Trashing a file on Ubuntu Linux deletes it unrecoverably](https://issuehunt.io/repos/19789032/issues/56)
---
Fixes #56 .
The changes are:
%Y-%m-%dT%H:%M:%S
in the local time.You can check the trash implementation in GNOME: https://gitlab.gnome.org/GNOME/glib/blob/glib-2-56/gio/glocalfile.c .
A code starting at line 2195 shows the appropriate style of trash info:
As for the second change, a comment starting at line 2181 is helpful. This comment and discussion ( https://bugzilla.gnome.org/show_bug.cgi?id=749314 ) shows the appropriate order of moveFile and writeFile.
I confirmed that the fixed code worked fine in Ubuntu 18.04. When I reverse the order of moveFile and writeFile in js, I always reproduce the hashed filename issue.
IssueHunt Summary
### Referenced issues This pull request has been submitted to: - [#56: Trashing a file on Ubuntu Linux deletes it unrecoverably](https://issuehunt.io/repos/19789032/issues/56) ---