visual c++ - Firefox auto deletes xpi from Profiles folder on load -


i created firefox add-on.

now when place current profiles folder manually , load browser, prompts installation. when copy .xpi file current profiles folder using vc++ executable , reload browser, auto-deletes .xpi file.

please guide going wrong. believe copying via vc++ executable raising issue.

here's code same :

file* pnreadfile = fopen(spndirptr->d_name, "r");  if (pnreadfile) {     char strdestfilename[max] = { 0 };                                       sprintf(strdestfilename, "%s\%s", ardestpath, xpi);      file* pnwritefile = fopen(strdestfilename, "w");    /*file pointer write in file*/      if (pnwritefile)     {         char buffer[max] = { 0 };    /*buffer store files content*/          while (fgets(buffer, max, pnreadfile))         {             fputs(buffer, pnwritefile);         }         fclose(pnwritefile);     }     else     {         printf("\n unable open file %s", strdestfilename);     }     fclose(pnreadfile); } 

i able figure out same. file i/o methods did not copy xpi because of xpi went corrupt , getting automatically deleted on firefox load. used system() copy command , able accomplish same suuccessfully.


Comments