#159473 - 2006-03-20 12:06 PM
problem with getfiletime()
|
ray2heavy
Fresh Scripter
Registered: 2006-03-15
Posts: 11
|
hey guys, wander if you can help. i am trying to extract the date of a file using the above command. here is my code:
$smsw_date_time=GetFileTime($smsw_location)
also tried with:
cd "z:\filelocation" $smsw_date_time=GetFileTime("file name.dfn")
the location is fine and is working for other copy etc commands so i know theres no problem there, but it still seems to return nothing.
im sure im doing something obviouse here, i think it just requires a more trined eye than my own.
thanx in advance
|
Top
|
|
|
|
#159476 - 2006-03-20 01:43 PM
Re: problem with getfiletime()
|
ray2heavy
Fresh Scripter
Registered: 2006-03-15
Posts: 11
|
got a bit of a problem due to privacy policies and the like and im unsure whether my employer would like me posting details about how their systems work but the file location is fine, as i say the same location worked in a copy statement and looks like this.
CD "y:\proram files\smartswitch
and the actual getfiletime statement is this
$smsw_date_time=GetFileTime("smartswitch.dfn")
the code is being run from a windows 2000 workstation and is accessing a file running on windows embedded (if that helps).
i am also using kixforms with this.
|
Top
|
|
|
|
#159477 - 2006-03-20 01:44 PM
Re: problem with getfiletime()
|
ray2heavy
Fresh Scripter
Registered: 2006-03-15
Posts: 11
|
sorry, missed the second " in th cd command
|
Top
|
|
|
|
#159479 - 2006-03-20 01:50 PM
Re: problem with getfiletime()
|
ray2heavy
Fresh Scripter
Registered: 2006-03-15
Posts: 11
|
ah, thats verry interesting to know as this file will be open and in use.
which is the oldest version that will do this?
|
Top
|
|
|
|
#159480 - 2006-03-20 01:50 PM
Re: problem with getfiletime()
|
ray2heavy
Fresh Scripter
Registered: 2006-03-15
Posts: 11
|
im using 4.51 by the way
|
Top
|
|
|
|
#159483 - 2006-03-20 01:56 PM
Re: problem with getfiletime()
|
ray2heavy
Fresh Scripter
Registered: 2006-03-15
Posts: 11
|
thanx, its throwing up @error=2 but the docs dont have a list of the number meaning for this function.
im assuming it means file already in use.
ill try updating kix and get back to you
|
Top
|
|
|
|
#159485 - 2006-03-20 02:31 PM
Re: problem with getfiletime()
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
To get the meaning of the message, either display @SERROR or use the DOS "NET HELPMSG" command, for example: Code:
net helpmsg 2
|
Top
|
|
|
|
#159486 - 2006-03-20 03:03 PM
Re: problem with getfiletime()
|
ray2heavy
Fresh Scripter
Registered: 2006-03-15
Posts: 11
|
ah, typo. whats error 3 ?
|
Top
|
|
|
|
#159488 - 2006-03-20 03:23 PM
Re: problem with getfiletime()
|
ray2heavy
Fresh Scripter
Registered: 2006-03-15
Posts: 11
|
ah, sorry missed that one.
cheers for the help guys, i really cant show u the code, its not worth my job the @SERROR will come in really useful though, thanx.
i will update the thread as soon as iv found it
any more suggestions would be gr8 if you have them
|
Top
|
|
|
|
#159489 - 2006-03-20 03:32 PM
Re: problem with getfiletime()
|
Mart
KiX Supporter
   
Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
|
MS has part of it's site devoted to error messages and what they mean.
See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/system_error_codes.asp for all error codes and the meaning of them.
Error code 3: The system cannot find the path specified. Looks like the getfiletime part just can't find the file. What happens when you give it the full path to the file and the filename?
Edited by Mart (2006-03-20 03:35 PM)
|
Top
|
|
|
|
#159492 - 2006-03-20 03:45 PM
Re: problem with getfiletime()
|
ray2heavy
Fresh Scripter
Registered: 2006-03-15
Posts: 11
|
exellent, it worked with the full path (slightly annoying but at least it worked)
can i assume we cant use variable location/file name with this function
???
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 202 anonymous users online.
|
|
|