Jump to content

File Generator


Nr31s
 Share

Recommended Posts

Hi, i'm trying to make a script that generate a file every 30 seconds, but all it can do is create the first file and refresh it every 30 seconds.

; File Location
$filepath = ".\"
$filelogs = "Log\"
$filepsc = "psc\"
; Filename
$filename = @YDAY & @HOUR & @MSEC
; Extensions
$logext = ".gtk"
$pscext = " .jpg"
; Encrypt Password
$cryptpwd = "test"
; Files Path
$fullpath = $filepath & $filelogs & $filename & $logext
$fullscr = $filepath & $filepsc & $filename
$i = 0
While $i >= -1
_FileCreate($fullpath)
FileWriteLine ($fullpath, _report())
_Crypt_DecryptFile($fullpath, $filepath & $filelogs & "_" & $filename & $logext, $cryptpwd, $CALG_RC4)
FileDelete($fullpath)
FileMove($filepath & $filelogs & "_" & $filename & $logext, $filepath & $filelogs & $filename & $logext)
Sleep(30000)
$i = $i + 1
WEnd

Can someone help me to pass this obstacle?

Appreciated all

Link to comment
Share on other sites

Nr31s,

I really doubt that the file is refreshed every 30 seconds if this is all that is running. After the first run $i becomes 0 which is > -1. Assuming you get by that hurdle, follow enaiman's advice and generate a new filename at every iteration.

Take another whack at it, if you need help, it's here!!

Good Luck,

kylomas

Edit: belay that, still giddy from the Greenbay game...however, as written there is no way to break out of the while loop. Also, if the day, hour and millisec have no significance than consider using the UDF _tempfile() (see helpfile)...

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...