Get all nVault entries?
Is there a way to collect or read through all of the entries in an nVault without knowing the names of all the keys? I thought about using the regular file functions to read through the nVault itself, but it uses zero characters so it can't all be read by AMXx.
Thanks. |
Re: Get all nVault entries?
has a way to do this been figured out ?
|
Re: Get all nVault entries?
Not by me at least. I decided to use my own flat file format (this was for GunGame).
|
Re: Get all nVault entries?
the sourcecode from nvault is available. try to port it to amxx
|
Re: Get all nVault entries?
Like I said, it wouldn't work. Null characters are written to the vault (not just at the end of a line or at the end of the file), and since Pawn uses null-terminated strings, it can't be properly read by Pawn.
|
Re: Get all nVault entries?
dont use read_file...
use the "new file natives". fopen, fread, fgetc, ect. |
Re: Get all nVault entries?
read_file calls fopen. The result is slower, but the same. It doesn't change how Pawn works in regards to null-characters.
|
Re: Get all nVault entries?
read_file, reads the file per line.
with the other file natives you are not forced to do this, since they are a direct wrapper to the standard c functions. btw. in C each string has the null character as the last char also. if you dont get it, read the file with fgetc... |
Re: Get all nVault entries?
If I use fgets, it will stop at the null character, or it will in essence because it records a null character and Pawn marks that as the end of the string. If I use some other function to read the entire file at once, I have to create a buffer massive enough to hold all of the data. Even if I do that, none of the Pawn string functions will work correctly on the data, since it has null characters.
|
Re: Get all nVault entries?
man, C and PAWN are using the same format for strings ( null terminated )
use fread and you will be fine... |
| All times are GMT -4. The time now is 06:48. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.