Sign in to follow this  
Followers 0
diikee

fileopen

7 posts in this topic

#1 ·  Posted (edited)

#include <IE.au3>
#include <File.au3>
$file = FileOpen("logfile_" &@MDAY &@MON &@HOUR &@MIN &"_" &$ip & ".txt", 10)
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf
FileWrite($file, "SQA Testing Started at: " & @MDAY & @MON & @YEAR & @HOUR & @MIN & @CRLF)


FileWrite($file, "SQA Testing Finished at: " & @MDAY & @MON & @YEAR & @HOUR & @MIN & @CRLF)
FileClose($file)

what am I missing?????

Edited by diikee

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I believe that your missing a path.

I also have to assume that $ip is declared somewhere.

Try.

$ip = 'Something'
$file = FileOpen(@scriptdir&"\logfile_" &@MDAY &@MON &@HOUR &@MIN &"_" &$ip & ".txt", 10)
Edited by Kerros

Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance.

Share this post


Link to post
Share on other sites

It's creating the file but never writes anything to it

Share this post


Link to post
Share on other sites

Mine comes out empty.....don't know how to explain it but it's 0 KB

logfile_11071154_10.100.47.6.txt 0 bytes

Share this post


Link to post
Share on other sites

Jos,

I actually waited for a few minutes and the file started getting populated....

.txt file

Electronic Shutter is set to: fixed 1/8 sec

Electronic Shutter is set to: fixed 1/5 sec

Completed: Clicked on r

console:

Electronic Shutter is to: fixed 1/8 sec

Electronic Shutter is to: fixed 1/5 sec

Complete: Overlay text set to: $IMGCDBG 2

Complete: LightGrabber set to: 1x

Light grabber is set to: 1x

Light grabber set successfully

Close oi

Complete: LightGrabber set to: disabled

Light grabber is set to: DISABLED

Light grabber set successfully

Close oi

I got more log on the console than in the text file

what might be causing the delay in writing to the file???

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