SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Problem with FileSize

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Problem with FileSize
Author Message
BillR69



Joined: 11 May 2007
Posts: 29
Country: United States

Post Problem with FileSize Reply with quote
I am having a problem with the FileSize command under 3.5.2. This problem did not occur under 3.4.x--as far as I know.

The code is:

onErrorResumeNext
FileSize filename file_size
GetLastError error_msg


The job aborts on the FileSize command when the file is in use by another process:

3/24/2009 12:21:57.850000 1 72 0 PrintChecks A run-time error occurred while executing automation script: Line 55. File not found

However, once the file is no longer in use, it works fine.

Are there some kinds of errors that onErrorResumeNext doesn't work on?
Tue Mar 24, 2009 1:49 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7850

Post Reply with quote
Are you sure "FileSize filename file_size" is in line 55? I mean the error is reported for that line and not something else?

In 3.4.x and earlier 24x7 uses ‘file open’ operations to get file size. In 3.5.x. it uses some kind of dir commands to get file listing, which enables getting size of files in use.

What is the value of filename variable? Can you post trace output of this job?


Last edited by SysOp on Fri Apr 03, 2009 11:41 am; edited 1 time in total
Tue Mar 24, 2009 5:21 pm View user's profile Send private message
BillR69



Joined: 11 May 2007
Posts: 29
Country: United States

Post FileSize Reply with quote
Yes, the FileSize command is on line 55. It is actually a Script library that checks to see if a file is available before calling jobs do something with the file. One of the checks in the library is for empty files and so I use FileSize to check for a zero byte file. I know it is line 55 because when I put logging commands above that line, the line of the error changes by the number of lines I inserted above it. I also get this error in all the jobs that use the script library.

One question I have is, does it matter that the filepath/name I am looking for is a network UNC path? For example, in the exact example I sent you the path where the file exists is "\\Depcon\prchecks$\Temp".
Wed Mar 25, 2009 2:43 pm View user's profile Send private message
BillR69



Joined: 11 May 2007
Posts: 29
Country: United States

Post FileSize Reply with quote
Did you ever have any more ideas on this FileSize issue? The problem seems to occur in the particular job in question because the file is taking a long time to be built by an application that extracts a Crystal Report in text format. Maybe there is something unique about how Crystal Reports locks the file vs how other applications create files. The other question was, do you think it has to do with this file being looked at on a network share?

Also, please forgive my ignorance, but what is a trace log for a 24x7 job? How do I get one?
Fri Apr 03, 2009 10:17 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7850

Post Reply with quote
To turn on tracing, go to Tools/Options menu; click Log page then tick Trace Enabled option, click OK and restart it.

Please check potential timing issues. You check for file size in one place but process it in a different place. Also you check that file size is not zero, but a non-zero file size doesn't mean that the file is non-locked, the process might be still wring it.

One way to check for a locked file is to try to open it using FileOpen. If this 'open' operation fails, the file is still used. If it succeeds, you just close it and continue to the main processing unit. Of course to streamline operations the check for lock and the main processing can be combined together in one script using carefully inserted OnErrorResumeNext and OnErrorGoTo
Fri Apr 03, 2009 11:40 am 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.