mIRC Home    About    Download    Register    News    Help

Print Thread
#45774 31/08/03 06:15 PM
Joined: Jan 2003
Posts: 119
A
AKO Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2003
Posts: 119
I've been playing around with the new File handling commands, as it could be of some definite use to me.

but I've got it structured like this

the text file consists of:

#channel1
#channel2
#channel3

just like that. I'm using fopen to open it to channels (/fopen channels channels.txt)

I can $fread(channels) and it returns #channel1. but /Fseek isn't seeming to work when I try to use it to switch to #channel3 via /fseek -w channels *3*.

Anyone got any idea here?

#45775 31/08/03 06:57 PM
C
codemastr
codemastr
C
It seems that /fseek -w and /fseek -r don't work correctly. If I use -w and specify anything other than * as the wildcard, it doesn't seem to do anything. Perhaps post this in the bug reports forum?

#45776 31/08/03 07:40 PM
Joined: Jan 2003
Posts: 119
A
AKO Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2003
Posts: 119
man, well i'll wait for 6.11 wink Which should be any time in the next few weeks I would imagine...to polish off any 'new' features to get them to work correctly.

#45777 31/08/03 10:00 PM
Joined: Jan 2003
Posts: 119
A
AKO Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2003
Posts: 119
Kind of sucks, too...I was hoping to use this function in a script I was going to write and replace the standard $read() function....

ahh well, in due time smile

#45778 01/09/03 09:16 AM
Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
/fseek -w seems to work fine for me. Try this alias:
Code:
alias testfseek {
  write -c blah.txt $+(#channel1,$lf,#channel2,$lf,#channel3,$lf,#channel4)
  .fopen a blah.txt 
  .fseek -w a *2* 
  echo 4 -a $fread(a) 
  .fseek -w a *4* 
  echo 4 -a $fread(a) 
  .fseek a 0
  .fseek -w a *3*
  echo 4 -a $fread(a)
  .fclose a
}
I typed /testfseek and it worked as expected: it echoed
#channel2
#channel4
#channel3


As my example alias implies, /fseek -w cannot seek backwards. For example, if you /fseek'ed to *4* you cannot /fseek to *3* directly. To do that, you'd have to reset the pointer to the beginning of the file (or to another point that you know it is before *3*) with /fseek <name> 0.

#45779 01/09/03 05:23 PM
Joined: Jan 2003
Posts: 119
A
AKO Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2003
Posts: 119
Hm..so that's how it works......that's very strange man......that's probably why it wasn't working before because I wasn't resetting the position....okay...it seems to work now....thanks.


Link Copied to Clipboard