Tutorial on how to use?
#1

Does anyone know of any tutorials on how to use fwrite/fread/fclose,
As im trying to make a admin script using it and dont really understand it,
So yeah does anyone know of any tutorials, IT HAS TO BE USING Fwrite
Reply
#2

doesnt it work very similarly to the php functions?

http://php.net/manual/en/function.fwrite.php
http://php.net/manual/en/function.fread.php
http://php.net/manual/en/function.fclose.php

anyways

as i understand the php one a bit better i thought i would get the grand larceny load vehicles script from files

file_ptr = fopen(filename,filemode:io_read);
fread(file_ptr,line,256)
fclose(file_ptr);

right

fopen is assigned a variable so that it can be closed via a variable

(line is a variable too heres the pwn : new line[256]

what the fread line is doing is reading the first 256 lines which can contain a maximum of 256 characters

fclose obviously close the open file (assigned by fopen)
Reply
#3

I dont know, Id really want it to be a tutorial for samp
Reply
#4

Код:
new File:myfile = fopen("File.ext",io_write);
fwrite(myfile,"Hello World");
fclose(myfile);
Код:
new File:myfile = fopen("File.ext",io_read),input[255];
fread(myfile,input); // It Read one Line...
/*while(fread(myfile,input)) ... Some code read all Lines */
fclose(myfile);
Reply
#5

Use WIKII!!
Reply
#6

First off: You already posted a topic with the same question before.
Second: I used the search function, and found this: http://forum.sa-mp.com/index.php?topic=69494.0
Hope it helped
Reply
#7

Quote:
Originally Posted by [ST
DutchBas ]
First off: You already posted a topic with the same question before.
Second: I used the search function, and found this: http://forum.sa-mp.com/index.php?topic=69494.0
Hope it helped
No offence to everyone else, But everyone else said, Wiki, Search ect, I HAVE already done.. Anyway yeah that helps ty man
Reply
#8

Quote:
Originally Posted by Torran
Quote:
Originally Posted by [ST
DutchBas ]
First off: You already posted a topic with the same question before.
Second: I used the search function, and found this: http://forum.sa-mp.com/index.php?topic=69494.0
Hope it helped
No offence to everyone else, But everyone else said, Wiki, Search ect, I HAVE already done.. Anyway yeah that helps ty man
Yeah, you searched alot...
https://sampwiki.blast.hk/wiki/Fwrite
https://sampwiki.blast.hk/wiki/Fclose
https://sampwiki.blast.hk/wiki/Fread
Reply
#9

Quote:
Originally Posted by Fedee!
Quote:
Originally Posted by Torran
Quote:
Originally Posted by [ST
DutchBas ]
First off: You already posted a topic with the same question before.
Second: I used the search function, and found this: http://forum.sa-mp.com/index.php?topic=69494.0
Hope it helped
No offence to everyone else, But everyone else said, Wiki, Search ect, I HAVE already done.. Anyway yeah that helps ty man
Yeah, you searched alot...
https://sampwiki.blast.hk/wiki/Fwrite
https://sampwiki.blast.hk/wiki/Fclose
https://sampwiki.blast.hk/wiki/Fread
Dude, When have they been called tutorials? There examples..
Reply
#10

Quote:
Originally Posted by [ST
DutchBas ]
First off: You already posted a topic with the same question before.
Second: I used the search function, and found this: http://forum.sa-mp.com/index.php?topic=69494.0
Hope it helped
this is the answering post
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)