|
When you delete a file its contents are as it is on disk, file system just mark it as "deleted" using some flag. Using any data recovery software you can get back your deleted file.Thats why I am overwrtting the file and also change the name (so that user can not recognise the file by name) and finally delete it.
If user getback his deleted file like this, the file will conatins the garbage conetent i.w no useful to user.
|
|
|
|
|
Okay, I get it now.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
so that is why you asked _commit in previous post,
try the WIN32 API equivalent,
BOOL FlushFileBuffers(
HANDLE hFile
);
may be useful.
|
|
|
|
|
Thank you, Its working
|
|
|
|
|
pther wrote: I want to erase the file content so that file could not be recover i.e completely destroyed from the system.
To do that correctly takes quite a bit of know-how. It is not as simple as just filling a file with one pass of random data (which, BTW, is more secure than using just zeros because the bit patterns are different) and then deleting the file.
Without even getting into issues like how magnetic media works and how "underlying" bit patterns can be recoverable using really expensive equipment (see: Peter Gutmann's paper on this[^]), simple things like the OS cache, and disk cache will interfere greatly.
For example, just because you wrote 1MB of data in code does not mean that it has made its way to disk (yet). It could hang around in the OS cache, and then in the disk cache. If you write the same file location multiple times (i.e. you were trying multiple write passes with different random data like you should), the disk might not get any of the writes except the last one.
You really need to research how caches work in your target OS as well as on disk drives, and then how modern magnetic storage works before going down this path. Tip - you will at least have to learn about which different bit patterns to write and how many times they need to be put on the media.
Why do I know this? Because I have written "secure deletion" software before, and debunked other so-called secure deletion programs as part of for-hire research (quite a few years ago and no, I cannot say the company). Today's drives may work a lot different than the ones I worked with before, so things may be even more difficult these days.
I will say that much of the "security" software out there do nothing more than offer a false sense of security.
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I think he is making a copy at some point, and then deleting the original... Still doesn't make sense though. Why not just modify that same file?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
No, It is not making any copy, I checked the file content throuh file system.
|
|
|
|
|
I remember that you asked this question some time ago. And you have not resolved yet?
Maxwell Chen
|
|
|
|
|
Maxwell Chen wrote: I remember that you asked this question some time ago. And you have not resolved yet?
solved this time [^]
|
|
|
|
|
Hi Experts,
How to use _commit(int fd)?
what is mean by fd-file descriptor?
Is there any example?
|
|
|
|
|
pther wrote: what is mean by fd-file descriptor?
file descriptor returned by api's like _open();
pther wrote: How to use _commit(int fd)?
int fd = _open( "sample.txt", _O_RDWR);
... write something to file.
_commit(fd);
"The _commit function forces the operating system to write the file associated with fd to disk. This call ensures that the specified file is flushed immediately, not at the operating system's discretion." from msdn;
|
|
|
|
|
I am using a rich edit control and when i paste data on richedit control than whatever be the size of data is paste as it is.but i want to give the standard size to the data. is there any api or message handler so that i set the size.
thanks in advance.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Shilpi Boosar wrote: when i paste data on richedit control than whatever be the size of data is paste as it is.but i want to give the standard size to the data. is there any api or message handler so that i set the size.
[add] are you looking for CRichEditCtrl::LimitText[^]? [/add]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi Rajesh,
Thanks for reply ....
When i paste any data on rich edit control than it size should be 7 (its an example).but when i paste data of font size 26 than it paste on richedit control with font size 26. i think now it is clear ...
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Handle the WM_PASTE command and covert the font size to required size.
|
|
|
|
|
i am using SendMessage(WM_PASTE,(WPARAM)0,(LPARAM)0); command but my issue is how i set the font size.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Shilpi Boosar wrote: i am using SendMessage(WM_PASTE,(WPARAM)...
It doesn't matter how the text is being pasted. You just need to add an appropriate handler to your control and write your code to format the text there.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I am using the appropriate handler but i dont find any message handler to set the size .EM_SETFONTSIZE doesnt work "error C2065: 'EM_SETFONTSIZE' : undeclared identifier"
Do you have any clue.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Shilpi Boosar wrote: i dont find any message handler to set the size .
You should find the handler of the rich edit control for the PASTE message, and then use the member function(s) of the rich edit control with which you could do formatting.
See Character formatting in Rich Edit Control[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Have you tried handling WM_PASTE for your control? Have a look at the members[^] of CRichEditCtrl, which may help you to set the format of the text which is being pasted.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Shilpi Boosar wrote: I am using a rich edit control and when i paste data on richedit control than whatever be the size of data is paste as it is.but i want to give the standard size to the data. is there any api or message handler so that i set the size.
try handlling CRichEditCtrl::Paste , there you could manipulate data before actually putting on editcontrol
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
i m properly handle it but the issue is different.do you have any message handler or api so that its font size should be fixed??
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Hey Shilpi,
I'm fiddling between two different machines (on my development machine, the internet is temporarily not working). You could use SetDefaultCharFormat[^] to set the default character format of your rich edit control. Any text entered would be according to the format you've specified with this call.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hello all,
HRSRC hResLoad = FindResource(AfxGetResourceHandle(),MAKEINTRESOURCE(IDR_IDR_EXE_EXEEXTRACTOR),"IDR_EXE");
when i write this line of code in vc 6 enviornmnet it works fine.
but when i write same line in vc 2005.
Its compiler gives error:-
error C2664: 'FindResourceW' : cannot convert parameter 3 from 'const char [8]' to 'LPCWSTR'
i am not getting how to remove this error......
can anybody help me in this....
Thanks in advance
|
|
|
|
|
neha.agarwal27 wrote: HRSRC hResLoad = FindResource(AfxGetResourceHandle(),MAKEINTRESOURCE(IDR_IDR_EXE_EXEEXTRACTOR),"IDR_EXE");
ADD L before string
HRSRC hResLoad = FindResource(AfxGetResourceHandle(),MAKEINTRESOURCE(IDR_IDR_EXE_EXEEXTRACTOR),L "IDR_EXE");
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|