Page 1 of 2 12>
Topic Options
#159473 - 2006-03-20 12:06 PM problem with getfiletime()
ray2heavy Offline
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
#159474 - 2006-03-20 12:46 PM Re: problem with getfiletime()
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
Would you mind posting the whole script?
is the filename file name.dfn ?

Example:

$Result = GetFileTime(@LDRIVE + "\Kix32.exe")
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#159475 - 2006-03-20 12:47 PM Re: problem with getfiletime()
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
Please post your script... There may be an other reason.
_________________________
Co


Top
#159476 - 2006-03-20 01:43 PM Re: problem with getfiletime()
ray2heavy Offline
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 Offline
Fresh Scripter

Registered: 2006-03-15
Posts: 11
sorry, missed the second " in th cd command
Top
#159478 - 2006-03-20 01:48 PM Re: problem with getfiletime()
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Check @ERROR (and @SERROR) after the GetFileTime() - this may give you a clue.

Note that only very recent versions of KiXtart will return data on open files. If you are using an older version and another program has the file open then you won't get anything.

Top
#159479 - 2006-03-20 01:50 PM Re: problem with getfiletime()
ray2heavy Offline
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 Offline
Fresh Scripter

Registered: 2006-03-15
Posts: 11
im using 4.51 by the way
Top
#159481 - 2006-03-20 01:52 PM Re: problem with getfiletime()
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
try this
_________________________



Top
#159482 - 2006-03-20 01:54 PM Re: problem with getfiletime()
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
It was supposed to be available in 4.51, but I have vague memories that it didn't work.

If you can, get hold of the latest version and check.

Also, check those error states - they can be very useful in debugging.

Top
#159483 - 2006-03-20 01:56 PM Re: problem with getfiletime()
ray2heavy Offline
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
#159484 - 2006-03-20 02:00 PM Re: problem with getfiletime()
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Nay,

2 would be "File not found"

what happens if you run this :

Code:

break on

$smsw_date_time=GetFileTime("y:\program files\smartswitch\smartswitch.dfn")
@error ?
$smsw_date_time ?

get $

exit 0



[Note the g in proram files ]


Edited by Jochen (2006-03-20 02:06 PM)
_________________________



Top
#159485 - 2006-03-20 02:31 PM Re: problem with getfiletime()
Richard H. Administrator Offline
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 Offline
Fresh Scripter

Registered: 2006-03-15
Posts: 11
ah, typo. whats error 3 ?
Top
#159487 - 2006-03-20 03:16 PM Re: problem with getfiletime()
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Did you not read Richard's advice and type:

net helpmsg 3

???
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#159488 - 2006-03-20 03:23 PM Re: problem with getfiletime()
ray2heavy Offline
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 Moderator Offline
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
#159490 - 2006-03-20 03:41 PM Re: problem with getfiletime()
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Well, he gave us already:

Quote:


CD "y:\proram files\smartswitch

and the actual getfiletime statement is this

$smsw_date_time=GetFileTime("smartswitch.dfn")





the strange thing here is y:\ ... shouldn't that be c: or d: (unless it is a mapped drive)
_________________________



Top
#159491 - 2006-03-20 03:43 PM Re: problem with getfiletime()
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
First CD-ing to the folder and doing a getfiletime on a file that should be in the folder you CD-ed to does that work?

If it does I learned something. Never tried it like this
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#159492 - 2006-03-20 03:45 PM Re: problem with getfiletime()
ray2heavy Offline
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
Page 1 of 2 12>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 202 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.079 seconds in which 0.03 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org