Harald said: | 1) instead of close, move the file pointer to eof | seek FILE, 0, 2; | so that the read fails without dying
This can't be, because the reading is from a socket not a file. I'm reading from a socket and writting to a file (in blocks of 10240 bytes). The read does stop when I abort. This method would certainly be good if I was reading from one file and ouptting to another. | or 2) just set a flag in the abort routine and if the reading routine finds | the flag set, it peacefully quits. The abort routine is not my method, furthermore it does not take any arguments, it just closes the socket and thus all data transfering. The problem I believe is because since my application is GUI and event driven(OOP), any action one place jumps you to another section of code, without knowing how to get back and say, "hey stop doing that, move on". Does this make sense? erick never stop questioning www.jeb.ca | Hi Erick, | | 1) instead of close, move the file pointer to eof | seek FILE, 0, 2; | so that the read fails without dying | | or 2) just set a flag in the abort routine and if the reading routine finds | the flag set, it peacefully quits. | | Hope that helps | Harald | | -----Original Message----- | From: Erick J. Bourgeois | To: perl-win32-gui-users@lists.sourceforge.net | Sent: 03.04.01 17:04 | Subject: [perl-win32-gui-users] Aborting a buffered write | | I have a process running, which is writting to a file(using print | instead of syswrite), | and I have a small dialogbox with a progressbar and an abort button. The | problem is when I | click the abort button, I get a GUI message "select: Bad file descriptor | at ... line 412". | This is the line where I read the data in, however, the event for the | Abort button closes | the data stream and the file I'm writting to. Plus the title for the | window error is a | subroutine which was a far ancestor to where it says the error is. This | is what the | Abort_Click looks like. | | sub Abort_Click { | close(FILE); | $data->abort(); | $ProgWin->Hide(); # <--progress dialogbox window | $MainWin->SetForegroundWindow(); | $MainWin->BringWindowToTop(); | GUI::Update($MainWin); | } | | I need a way tell the subroutine that is showing the progress to stop | reading data and | move on. Any ideas? | | erick | never stop questioning | www.jeb.ca | | | _______________________________________________ | Perl-Win32-GUI-Users mailing list | Perl-Win32-GUI-Users@lists.sourceforge.net | http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |