Random replication hard disk, can prevent the general data recovery???

Source: Internet
Author: User

Random replication hard disk, can prevent the general data recovery???

1#include <stdio.h>2#include <stdlib.h>3#include <string.h>4 5 #defineFile_size (1024 * 1024 * 1)6 #defineFile_count (1 * 100)7 #defineFck_loop (3)8 9 intMainvoid)Ten { OneFILE *FP =NULL; A     Charfile_name[ +]; -UnsignedChar*data =NULL; -     intI, J, Len, Fck_loop; the      -data = (unsignedChar*)malloc(file_size); -     if(Data = =NULL) -     { +printf"malloc%d error!! \ n", i); -         Gotoend; +     } A      atFck_loop =0; -      while(Fck_loop <fck_loop) -     { -         //For (i = 0; i < File_count; i++) -i =0; -          while(1) in         { -             if(Fck_loop = =0) to             { +memset (data,0x00, file_size); -             } the             Else if(Fck_loop = =1) *             { $memset (data,0xFF, file_size);Panax Notoginseng             } -             Else the             { +Srand (i ^0x835); A                  the                  for(j =0; J < File_size; J + +) +                 { -DATA[J] = rand ()%0xFF;  $                 } $             } -  -              thesnprintf (file_name,sizeof(file_name)-1,"fck_file_%08d", i); -printf"%s\n", file_name);Wuyi              thefp = fopen (file_name,"w+"); -             if(fp = =NULL) Wu             { -printf"Create%s error!! \ n", file_name); About                 //Goto end; $                  Break; -             } -              -Len = fwrite (data,1, File_size, FP); A             //printf ("Fwrite len:%d\n", Len); +             if(Len! = file_size *1) the             { -printf"Write%s error!! \ n", file_name); $                 //Goto end; the                  Break; the             } the              the fclose (FP); -i++; in         } theSystem"del fck_file_*"); thefck_loop++; About     } the      Free(data); the      the End: +     return 0; -}

Random replication hard disk, can prevent the general data recovery???

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.