Sign in to follow this  
Followers 0
Armand

FileOpen() ERROR! - when trying to recv from tcp.

7 posts in this topic

#1 ·  Posted (edited)

i use the following :

FileWrite("TryingShit.tmp",1)
While FileGetSize("TryingShit.tmp")<10000000
    $file = FileOpen("TryingShit.tmp",17)
    If $file = -1 Then
        ConsoleWrite("-6, couldn't open the file: "&$file&" for writing!"&@CRLF)
        Exit
    EndIf
    $ret = FileWrite($file,"0x1E00008D542408528D4C241451E85BD900008B04242B4424088943188BC383C4205BC3538BD85683C4E8668B038BF2


6689442408668B5304668954240A668B4B0866894C240E668B430C6689442410668B53106689542412668B4B1466894C2414


66C74424160000548D44240C50E8FAD800008B43180104243B04247604FF442404568D54240452E88CD8000083C4185E5BC3


83C4F8833800750733C033D2595AC38BD4E87AFFFFFF8B44240433D28BD033C052508B44240833D20304241354240483C408


595AC39090908B083B0A75308B48043B4A0475288B48083B4A0875208B480C3B4A0C75188B48103B4A1075108B48143B4A14


75088B40183B4218740433D2EB05BA010000008BC2C3909053568BF28BD88BC3E877FFFFFF52508BC6E86EFFFFFF3B542404


75083B04240F92C0EB030F9CC083E00183C4085E5BC353568BF28BD88BD68BC3E8C1FFFFFF84C075118BD68BC3E870FFFFFF


84C0750433C0EB05B8010000005E5BC38B50148B4810C1E105D1EA0BD18B480CC1E10B0BD18B4808C1E1100BD18B48048B00


C1E1152DBC070000C1E0190BD10BD08BC2C38BCA83E11F03C98948148BCAC1E90583E13F8948108BCAC1E90B83E11F89480C


8BCAC1E91083E11F8948088BCAC1E915C1EA1983E10F89480481C2BC070000891033D2895018C390538BC8F6C103751C8BC1


BB6400000099F7FB85D275128BC1B99001000099F7F985D2740433C0EB05B8010000005BC3905356578BF98BDA8BF0E8E2EB


FFFF85C0741485DB741066833B00740A6A0053E8D6D50000EB086A0056E8C6D5000085C0740F8BCF8BD38BC6E8AF03000033


C0EB1BE850D6000083F802740583F8037507B802000000EB05B8010000005F5E5BC35356575581C4E8F3FFFF8BE833C0884C


240489142489442408833C240074128B142466833A007409E86F99000084C0750433DBEB05BB01000000C644240C00C64424


0D018BFD33F685FF74108BC72BC53D000400007D05803F007505C644240C0184DB741A81FE000400000F8DF10000008B1424


66833C72000F84E300000084DB750B807C240C000F85D400000084DB740A8B0C2466833C715C741584DB0F858D00000033C0


8A0783F85C0F858000000033D284DB89542410741D8D4424188BCE8B1424E80399000066C744741800008D44241889442410


807C240C0074178D942418080000B9000000018B442410E8A0960000EB1E8BCF2BCD8D8424180800008BD5E8E49000008BCF


2BCDC6840C18080000008D8424180800008B4C24088B542410E878FEFFFF85C07405C644240D00807C240C007524897C2414


803DC0BA4100007410B8C0B941008B542414E89D990000EB058B442414408BF846E9E6FEFFFF807C240400752A8BC5E888F3


FFFF0FB600E884F6FFFF84C075178B4C24088B14248BC5E816FEFFFF85C07405C644240D008A44240D81C4180C00005D5F5E


5BC39090558BEC83C4DC535657894DF88955FC8BF8E8D6E9FFFF85C00F8434010000837DFC0074108B45FC8338000F95C283


E20184D2750433C9EB05B901000000884DF7837DF80074108B45F88338000F95C283E20184D2750433C9EB05B90100000088


4DF6837D080074108B45088338000F95C283E20184D2750433C9EB05B901000000884DF533D28BC7E82F0100008BF083FEFF


7408F7C601000000750433C0EB05B8010000008845F4807DF400740B33C933D28BC7E82F0100006A0068000000026A036A00


6A03680000004057E82BD300008BD883FBFF747A807DF700740B8D55EC8B45FCE81FFBFFFF807DF600740B8D55E48B45F8E8


0EFBFFFF807DF500740B8D55DC8B4508E8FDFAFFFF807DF70074058D4DECEB0233C951807DF50074058D45DCEB0233C05080


7DF60074058D55E4EB0233D25253E805D4000053E8A3")
    If $ret = 0 Then
        ConsoleWrite("-7, couldn't write the data to the file: "&$file&@CRLF)
        Exit
    EndIf
    $ret = FileClose($file)
    If $ret = 0 Then
        ConsoleWrite("-8, couldn't close the file handle: "&$file&@CRLF)
        Exit 
    EndIf
WEnd

as just an example for my real code which instead of writing the above line get a different line from a tcp connection.

the process is working propperly, Recieving and Saving the data to the file, opening->writing->closing the file, over and over again untill somehow in the middle of the process (every time in different location) it's giving me an error on the FileOpen part of the script (which is formed just as the above !!!)

+i've figured hey... it must be because there is a failure in closing the file and thus as it is still open it can't be opened again... -but then again - the fileclose function never returns an error (or exits the script for that matter...)

+then i've tried the above code to see if the fileopen() func has a limit to file size.

- noep, no such limit... worked up to the entire 10000 bytes...

+My most recent idea is that the fileOpen() func has a certain timer which limits the opening of a certain file too many times in a certain time-integer...

- as i've just read what i wrote i've realized that that can't also be true since the 'While' loop is just as fast as the While loop in my script... :)

- why does such phenomena occur ?!

- how do i ovade it ?!

ANY HELP WILL BE APPRICIATED !!!

Edited by Armand

[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Share this post


Link to post
Share on other sites



no pop-up error msg !!!

the function 'fileOpen()' returns '-1' after a while as i've explained !!!

my version is (as just returned by auto-update-it) 3.2.8.1

- just now first time the error wasn't returned... seems randomatic!


[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Share this post


Link to post
Share on other sites

no pop-up error msg !!!

the function 'fileOpen()' returns '-1' after a while as i've explained !!!

my version is (as just returned by auto-update-it) 3.2.8.1

- just now first time the error wasn't returned... seems randomatic!

ran it 5 times without any errors....

Are you using a local harddrive to store it on or something else ?


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

i'll say it again... it's not happening with this code but with my original code which is too long to put here... but does the same action ...

saving to local hd.


[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Share this post


Link to post
Share on other sites

i'll say it again... it's not happening with this code but with my original code which is too long to put here... but does the same action ...

saving to local hd.

ok... I am done ...

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

My guess is that the script you can't post exhausts the filesystem. So you have to do a sleep or a flush the filesystem. I have experienced something similar some years ago. Don't remember how I did the flush but found it at MSDN, so it is left as an exercise..:)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0