[Ajuda] Read and Write
#1

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"

Reply
#2

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)