Re: Trash system



rik kde org writes:

> #if Maciej Stachowiak
> > But why these? There's no way to restore the ctime when undeleting,
> 
> Correct.
> 
> > first off (POSIX lets you set the mtime and the atime but not the
> > ctime) but aren't the file's size, mode and dates already available
> > when stat()ing the file?
> 
> Yes, but if you want to view a large trash directory, it's a lot faster
> to only read the info files than stat the 'deleted' files as well.
> 

You will need to stat() the deleted files anyway, to get other info
like ownership, whether it's a directory, etc, unless you duplicate
all of struct statbuf in the info file. You may also need to read part
of the actual file to get the mime type. I think it would be
preferrable to store only info that can't be kept on the deleted file
itself. I suspect mtime and deletion time will be enough to identify
the file, so I am not sure storing original ctime is that useful
either.

 - Maciej





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]