how to make the contents of a file disappear after x numbers of days or at date
On Thu, 2010-09-09 at 14:04 +0000, user1 wrote:
> >> I should be a kind of wipe operation :-)
> > Can you explain what you mean with "disappear"? Should the result be an
> > empty file or e.g. a file with the same length and random data?
> I mean the result should be an empty file (or a part of a file), where
> the "wiped" data is gone and cannot be restored.
You can't create a data file that "deletes itself" - at least not in any
common operating system and not under Linux.
Some applications delete certain files automatically - for example, most
browsers manage a cache - but I assume you don't mean that sort of
thing.
I believe there are object-oriented operating systems in which such a
thing might be possible, but Linux isn't one of them.
You could create a setup in which files will be deleted automatically
based on their file date or other characteristics; even based on their
contents - for example, a cron job running periodically. However, it
would be the cron job doing the deleting. A file is itself inert.
Sounds like you are trying to out-DRM Apple :-) in which case my sincere
advice is wake up and smell the future... because it won't include you.
Why not tell us what you are actually trying to achieve? Maybe if you
told us the actual problem, we could suggest other ways to solve it.
how to make the contents of a file disappear after x numbers of days or at date
On Thu, 2010-09-09 at 16:52 +0200, Mark Widdicombe wrote:
> >You can't create a data file that "deletes itself" - at least not in any
> >common operating system and not under Linux.
>
> I don't see why not. You can incorporate a routine in the file
> (assuming it's executable) that would check the date and if it's
> greater than a certain date calls an OS routine that will delete the
> file stored on disk. It won't effect the file in memory, but the next
> time the file tries to load it won't be there.
The OP wrote about image files. Not sure where you would splice in such
a routine.
But my statement stands for ALL files in a non-object-oriented operating
system; even an executable has to be run by something outside itself. No
file can "delete itself".