Link to home
Start Free TrialLog in
Avatar of George Tokas
George TokasFlag for Greece

asked on

Use of deleted files.

Another idiotic question:
Same senario, Windows Operating System.
We have an application uses files to load from pictures and sounds. The files are many.
When those files are loaded the application in EVERY FILE writes random values and delete them afterwards.
There is no way that those files restored or copied again in the specific location they were.
HOW MANY TIMES this application will work properly and why.

Again thanks in advance,

George Tokas.
SOLUTION
Avatar of Kent Olsen
Kent Olsen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of George Tokas

ASKER

Hello again Kent and from this Q,
In an article on cryptography on bcbjournal I proposed:
1. Load the file in a buffer
2. fill the contents with random values,
3. save the file.
4. Repeat steps 1,2 and 3 at least 2 more times.
5 Finaly delete the file.

But this is not the issue here...
We are opening the file with fopen() and we read each position from the start and change it with a random value (fget(), fput() ) and then deleting the file.
NOW:
There is no way that those files restored or copied again in the specific location they were.
HOW MANY TIMES this application will work properly and why.

George Tokas.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello ciuly and thank you for answering.
>> There is no way that those files restored or copied again in the specific location they were.
I mean that the application we are discussing has no means to do such a thing you describe.
Of course are many ways but they are NOT described.
To propose a way and myself, inside a local network, if it is a shared folder - example a drive in Windows98 PC - then from another PC you can add whatever you like, wherever you like, and all the rest you are describing.
The fact is that none of the above is described as function.

>>BUT, the simplest way of achieving this is to make a disk sector by sectro copy/backup and restore it after operation :)
Check my previous post with a part from my article and tell me if after that will be easy....

Thanks for the support,
George Tokas.
>>BUT, the simplest way of achieving this is to make a disk sector by sectro copy/backup and restore it after operation :)
Check my previous post with a part from my article and tell me if after that will be easy....

of course. it doesn't matter what you do.

let me explain a little deeper:

step 1:
- make a disck sector by sector copy. (attention: *disk*. this is independent of operating system, file system, etc)
step 2
- run your program. do whatever you want. format the disk. recreate partitions, install inux. finally, zero out the disk etc.
step 3
- restore the disk by sector by sector copy

result: you will have the exact same disk contents as before step 2.

obviously, this behaviour is not present in your application or any other usual application since it requires direct AND exclusive disk access. but as I was saying, this is possible (there are a ton of porograms out there that already do this. one of the oldest is norton ghost)

now, if we are talking about a normal day-to-day application, your algorithm is too complicated.
a simpler algorithm will get you in the same position of not beeing able to recover a file content after deletion:

- open file
- replace the content with whatever you want (for example character 0)
- flush the disk
- resize the file to 0 bytes
- close the file

at this stage, if you want, you can delete it. the contents already cannot be recovered because:
1) the content was overritten
2) the filesystem doesn't know the original file size. it knows that the filesize is 0 :)

considering large files, you don't want to repeat a file-wide operation. doing it once cna be lengthy enough, dong it 2-3 times can kill one persons mind :P
I am covered.
So considering all these except that there is a way of restoring, since it's never described,
HOW many times the application will work properly, and I mean displaying the result it suppose to display?

George Tokas.
I am not sure what you mean, but IF
- the application is supposed to display a picture
- that picture is begin "destroyed" with your presented algorithm
- that picture is beeing deleted

exactly once. as I said, after you deleted the file, that file cannot be used anymore. ANOTHER file yes, but not that same file.

same goes for any filetype.

Hi George,

If you WANT to ensure reusability, copy the files that will be modified to a backup folder.  After the application runs, replace the modified file by opening it for update, and copying the backup file over it.  Assuming that the file length hasn't change (it shouldn't) the file will be restored in the exact location that it currently occupies.

Of course, if the file has been deleted, all bets are off as the sectors/clusters are returned to the free chain in an order that doesn't guarantee that they will be reused in the same order.


Kent
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok. Restating:
We have an applicatin that displays in the form some pictures (bitmaps) and plays lets say a sound.
The application loads the bitmaps and the sounds from CERTAIN FILES inside a CERTAIN DIRECTORY.
When the application starts and displays the form with the pictures and playing the sounds:
1. Writes random values to the content of EACH FILE and
2. Deletes the files.

The question is:
HOW MANY TIMES the picture and sound files can be used for the application to work properly...

NOTICE.
There is no way the files to be restored or copied again.

George Tokas.
As I understand it...
To perform properly, the application must read the file, then scramble it.

Thus, each file will be able to be played just once.

The program will continue to work properly forever, but when functioning properly, it will be able to play each file just once.

That answer is so obvious that it makes me think that I still don't understand the question.
Hi DanRollins,
I understand your puzzling....
You will have the answer for the reason of this idiotic question in the next 24H...
There is a "findings report" along with a "description" someone else made that I can't YET made them public...
THANKS FOR THE POST.

George Tokas.
>>THANKS FOR THE POST
AND FOR YOUR SUPPORT!!!

There is no way to underline so I hope you understand that I'm greatfull...

George Tokas.
Hello again and thanks everybody for the support...
I just went back from the court house and the verdict was NOT guilty....
Now that all is over I can describe you the reason for this IDIOTIC question....
I hope you read my trouble at: http://www.gtokas.com 
In the report the employee made describes a functionality that is the same as I described added only that the application is controlled by some other application...
There was NO description on how those deleted files restored in order the system to work properly again...

@DanRollings
Even though we didn't met here under the best conditions - in my first question in C++ area you accused me for a hacker (or I understand it that way)- that DOESN'T mean that I'm not respecting you or have any bad oppinion...
In fact if I were in your shoes I maybe had posted the same way...

@ciuly
Same with the other question for you my friend for leaving your area of experties to support me...

@kdo
I don't think that I had to add anything more my friend...:-)

Again thinks for the support...
I'm accepting all answers and if you ever need anything you know how to contact me...

George Tokas.
glad it's over in your favor :)

take care
Thanks my friend....
But they maybe forgot that soon (after 30 days) will be my turn to expose their lies and manipulations...
I will update www.gtokas.com as soon as I can....

George.