SA-MP Forums Archive
[Ajuda] Read and Write - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Read and Write (/showthread.php?tid=597504)



Read and Write - F1N4L - 01.01.2016

Porque esse code da um erro sendo nativo do samp.

PHP код:
// Open "file.txt" in "read and write" mode
new File:handle fopen("file.txt"),
 
    
// Initialize "buf"
    
buf[128];
 
// Check, if file is open
if(handle)
{
    
// Success
 
    // Read the whole file
    
while(fread(handlebuf)) print(buf);
 
    
// Set the file pointer to the first byte
    
fseek(handle_seek_begin);
 
    
// Write "I just wrote here!" into this file
    
fwrite(handle"I just wrote here!");
 
    
// Close the file
    
fclose(handle);
}
else
{
    
// Error
    
print("The file \"file.txt\" does not exists, or can't be opened.");

Quote:

error 017: undefined symbol "seek_begin"




Re: Read and Write - Dayvison_ - 01.01.2016

Quote:
Originally Posted by Wiki Samp
Whences
seek_start Set the file position relative to the start of the file (the position parameter must be positive).
seek_current Set the file position relative to the current file position: the position parameter is added to the current position.
seek_end Set the file position relative to the end of the file (parameter position must be zero or negative).
Nгo й seek_begin й seek_start.

fseek