mIRC Home    About    Download    Register    News    Help

Print Thread
#74634 09/03/04 08:04 PM
O
Olathe
Olathe
O
/write -l0 will overwrite the first line of a file. This is disastrous if someone uses $readn to find and delete or overwrite a line without checking to see if $read succeeded.

Plus, it doesn't make sense to delete the 0th line.

#74635 09/03/04 08:15 PM
T
TonyTheTiger
TonyTheTiger
T
starbucks_mafia
ahhh k got it .. thx for clearin that up.

Olathe
good point

Last edited by TonyTheTiger; 09/03/04 08:38 PM.
#74636 09/03/04 08:29 PM
Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
The point he's making is that people might use $readn in a script to overwrite a line just read, and then if the read fails they'll end up overwriting the first line.

#74637 09/03/04 08:51 PM
Joined: Dec 2002
Posts: 1,893
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,893
I would expect -l0 to replace the first line only if it's a number (which represents the amount of lines), seeing how $read(file,0) works exactly in the same way.

#74638 13/03/04 12:37 AM
O
Olathe
Olathe
O
No, it also removes the line if it is not a number.

#74639 13/03/04 12:48 AM
Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
* tidy_trax fixes a few of his scripts shocked


Link Copied to Clipboard