]> git.pld-linux.org Git - packages/extundelete.git/blame - extundelete-attrs.patch
- restore atime, mtime, mode, user, group and directories, print dtime, rel. 2
[packages/extundelete.git] / extundelete-attrs.patch
CommitLineData
f50bab4c
TP
1--- a/src/extundelete.cc 2010-05-16 03:51:15.000000000 +0200
2+++ b/src/extundelete.cc 2012-01-01 15:54:07.000000000 +0100
3@@ -89,6 +89,7 @@ Important future enhancements:
4 #include <fcntl.h>
5 #include <unistd.h>
6 #include <utime.h>
7+#include <sys/time.h>
8
9 /* GNU headers */
10 #ifndef HAVE_GETOPT_H
11@@ -2532,8 +2533,14 @@ int restore_inode(ext2_filsys fs, ext2_f
12
13 if(!flag) {
14 if (truncate( (outputdir + fname2).c_str(), EXT2_I_SIZE(inode)) == 0) {
15+ struct timeval times[2];
16+ chmod((outputdir + fname2).c_str(),inode->i_mode);
17+ lchown((outputdir + fname2).c_str(),inode->i_uid,inode->i_gid);
18+ times[0].tv_sec=inode->i_atime; times[0].tv_usec=0;
19+ times[1].tv_sec=inode->i_mtime; times[1].tv_usec=0;
20+ utimes((outputdir + fname2).c_str(),times);
21 std::cout << "Restored inode " << ino << " to file ";
22- std::cout << (outputdir + fname2) << std::endl;
23+ std::cout << (outputdir + fname2) << " deleted " << asctime(localtime((time_t*)&inode->i_dtime));
24 retval = 0;
25 } else {
26 std::cout << "Failed to restore inode " << ino << " to file ";
This page took 0.083406 seconds and 4 git commands to generate.