Jump to content
Sign in to follow this  
frankzappa

Problem with FileGetTime

Recommended Posts

frankzappa

hey all,

i'm trying to use FileGetTime in a bot but i'm stuck in this error:

CODE
$temp = FileFindNextFile($search)

$d = FileGetTime($temp)

$date = $d[0] & $d[1] & $d[2] & $d[3] & $d[4] & $d[5]

the error i got is the following:

==> Subscript used with non-Array variable.:

$date = $d[0] & $d[1] & $d[2] & $d[3] & $d[4] & $d[5]

$date = $d^ ERROR

Can someone help me? thanks from the newbie...

Share this post


Link to post
Share on other sites
weaponx

FileGetTime() needs the full path to the file, which would be the path used for FileFindFirstFile().

$path = "C:\"

$search = FileFindFirstFile($path....)

.

.

.

$temp = FileFindNextFile($search)

$d = FileGetTime($path & $temp)

$date = $d[0] & $d[1] & $d[2] & $d[3] & $d[4] & $d[5]

Share this post


Link to post
Share on other sites
frankzappa

The problem was in the path, as Wolverine said. FileFindFisrtFile doesn't return the hole file name with the path, you have to add it by yourself.

Thanks!

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  

×