Advertisement
FoxHound

fremoveline (linenumber version)

Sep 7th, 2011
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.38 KB | None | 0 0
  1. stock fremoveline(filedir[],line)   //bY FoxHound
  2. {
  3.     if(!fexist(filedir)) { return 0; }
  4.     new rdline[196],str[1024],File:tmpfile = fopen(filedir,io_read);
  5.     for(new i=0;fread(tmpfile,rdline);i++) {
  6.         if(i==line) { continue; }
  7.         strins(str,rdline,strlen(str)); }
  8.     fclose(tmpfile),fremove(filedir);
  9.     tmpfile=fopen(filedir,io_write);
  10.     return fwrite(tmpfile,str),fclose(tmpfile),1;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement