hey again
the new file handling is supercool.
but it is a new feature, i'm sure that's why it still has a few bugs.
first, that i've mentioned in another forum, that as i see /fopen tryes to open the file for reading and writing both, and that causes failure when trying to open a read-only file. i'd suggest to add a -rw switch. my idea: if no -rw is specified, then use read & write opening
if -r is specified, then open for reading, if -w, then for writing, so if -rw, then for read & write
the another thing:
sometimes $eof and $fopen().eof returns $false and waits until the position reaches the file's size + 1 byte. that caused much problem with my mirc webserver, i had to set a variable that checks file size, and if $eof == $false, but $fopen().pos >= $file().size, then it forces to act like if $eof == $true
i hope i was understandable
another thing, that it is great that now $file can return file attributes either, but it'd be good to write down what letters mean what attributes, for example, if it returns "a", i can only hardly think it means archiveable or what
and a file attributes _changing_ command, for example /attr file attribs would be good either
AND:
$read has great searching functions, but it opens and closes the file in every call, is slow, and fails if it cant open the file, but sometimes i sill have to use it because if i'd go through a file with a while cicle, it would add a lot of errors and should be much more slower.. but $read is dangerous
so i suggest, that with the new filehandling, $read would have an option to make us capable of using $read's search-toys on already opened files, without the danger of our script halts
and if you have wrote a brand new, and much better filehandling, you should do the same with directory handling. i dont know much about how does Window§ handle this, but i think u have to open directories aswell to get a filelist or something. like $read crawls through the file, fopen speeds over it
$findfile and $finddir are slow either, i'm sure because the $read, it opens & close directories in every call, well i dont know, u know the answer, khaled
so i'd love /dopen /dclose /dseek... commands, just like the new filehandling, but for directory listing.
and $ferr and $fopen().ferr should return an error message if possible, n ot only true/false
or to let the already wrote for truefalse scripts work, you should add a .emsg or somethinglikethat property to $fopen, that'd give an error message if any.