SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Error 106:Error opening File

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Error 106:Error opening File
Author Message
Pierre Dupuis



Joined: 22 Aug 2000
Posts: 85

Post Error 106:Error opening File Reply with quote

Sometime when i try to open a file with FileOpen and i got this message : "An error occured while executing script:Line 106:Error opening file."

106 FileOpen (file_ord,"StreamMode","Read",True,file_handle_ord)
107 IfThen( file_handle_ord, CHECK_TARGET_EXIST)
108 FileClose file_handle_ord
109 goto NO_PROCESS_END

Can i trap this error so the program will not end adnormaly.

Please help.

Thanks.

Thu Nov 02, 2000 11:37 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Re: Error 106:Error opening File Reply with quote

Why don't use the FileExists statement instead?

By the way, a workaround for reading openeed/locked files is to use the DOS TYPE command

Run("cmd /b type somefile.here filecopy.here")
FileReadAll("filecopy.here", variable)
FileDelete("filecopy.here")

: Sometime when i try to open a file with FileOpen and i got this message :
: "An error occured while executing script:Line 106:Error opening
: file."

: 106 FileOpen
: (file_ord,"StreamMode","Read",True,file_handle_ord)
: 107 IfThen( file_handle_ord, CHECK_TARGET_EXIST)
: 108 FileClose file_handle_ord
: 109 goto NO_PROCESS_END

: Can i trap this error so the program will not end adnormaly.

: Please help.

: Thanks.

Thu Nov 02, 2000 12:02 pm View user's profile Send private message
Pierre Dupuis



Joined: 22 Aug 2000
Posts: 85

Post Re: Error 106:Error opening File Reply with quote

I'm already using FileExists before opening the file (see below).

CHECK_ORD:
FileExists(file_ord,file_found)
IfThen( file_found, CHECK_CUS_READY)
goto NO_PROCESS_END

CHECK_CUS_READY:
FileOpen (file_cus,"StreamMode","Read",True,file_handle_cus)
IfThen( file_handle_cus, CHECK_ORD_READY)
FileClose file_handle_cus
goto NO_PROCESS_END

CHECK_ORD_READY:
FileOpen (file_ord,"StreamMode","Read",True,file_handle_ord)
IfThen( file_handle_ord, CHECK_TARGET_EXIST)
FileClose file_handle_ord
goto NO_PROCESS_END

There is no anyway to trap this error instead of using DOS type?
Why "file_handle_cus" or FileOpen does not return a error instead of stopping the program?

Thanks.

: Why don't use the FileExists statement instead?

: By the way, a workaround for reading openeed/locked files is to use the DOS
: TYPE command

: Run("cmd /b type somefile.here filecopy.here")
: FileReadAll("filecopy.here", variable)
: FileDelete("filecopy.here")

Thu Nov 02, 2000 12:16 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Re: Error 106:Error opening File Reply with quote

You can turn on "ignore errors" job property so the script will continue running even if the file cannot be opened. if FileOpen fails, file_handle_cus will not be changed and will stay 0, and so the script will proceed to NO_PROCESS_END.

: IfThen( file_handle_cus, CHECK_ORD_READY)
: FileClose file_handle_cus
: goto NO_PROCESS_END

: I'm already using FileExists before opening the file (see below).

: CHECK_ORD: FileExists(file_ord,file_found)
: IfThen( file_found, CHECK_CUS_READY)
: goto NO_PROCESS_END

: CHECK_CUS_READY: FileOpen
: (file_cus,"StreamMode","Read",True,file_handle_cus)
: IfThen( file_handle_cus, CHECK_ORD_READY)
: FileClose file_handle_cus
: goto NO_PROCESS_END

: CHECK_ORD_READY: FileOpen
: (file_ord,"StreamMode","Read",True,file_handle_ord)
: IfThen( file_handle_ord, CHECK_TARGET_EXIST)
: FileClose file_handle_ord
: goto NO_PROCESS_END

: There is no anyway to trap this error instead of using DOS type?
: Why "file_handle_cus" or FileOpen does not return a error instead
: of stopping the program?

: Thanks.

Thu Nov 02, 2000 12:28 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.