[Openroad-users] GetFileTime (or FindFirstFile) WindowsAPI

rune.randoy at akersolutions.com rune.randoy at akersolutions.com
Wed Jun 4 23:29:42 EST 2008


Hi,

External object works like a dream:

 

procedure tst_findfirstfilea() =

declare

 filename     = varchar(255) not null;

 o_FS         = E_MicrosoftScriptingRuntime!FileSystemObject;

 o_File       = E_MicrosoftScriptingRuntime!File;

 sz           = integer not null;

 typ          = varchar(255) not null;

{

 filename     = 'c:\temp\t.sql';

 o_File = o_FS.GetFile( filename );

 sz  = o_File.size();

 typ = o_File.type();

 message filename + ' attributes='   + varchar(o_File.attributes)

                  + ' lastmodified=' + varchar(o_File.datelastmodified)

                  + ' lastaccessed=' + varchar(o_File.datelastaccessed)

                  + ' created='      + varchar(o_File.datecreated)

                  + ' size='         + varchar(sz)

                  + ' type='         + varchar(typ);

}

 

Thanks a lot.

Rune Randøy 

________________________________

From: openroad-users-bounces at peerlessit.com [mailto:openroad-users-bounces at peerlessit.com] On Behalf Of Pete Wilkinson
Sent: 4. juni 2008 14:59
To: International OpenROAD Users; openroad-users at sealion.peerlessit.com
Subject: Re: [Openroad-users] GetFileTime (or FindFirstFile) WindowsAPI

 

You could use the FileSystemObject from the 'Microsoft Scripting Runtime' External Library ...

 

Some example code:

 

oDocFile             = FileSys!File;          

oFS                    = FileSys!FileSystemObject; 

 

        oDocFile = oFS.GetFile ( wv_filename_v );

 

And then access various attributes/properties like oDocFile.DateLastModified

 

others are shown here : http://msdn.microsoft.com/en-us/library/ea5ht6ax(VS.85).aspx

	-----Original Message-----
	From: openroad-users-bounces at peerlessit.com [mailto:openroad-users-bounces at peerlessit.com]On Behalf Of rune.randoy at akersolutions.com
	Sent: 04 June 2008 13:51
	To: openroad-users at sealion.peerlessit.com
	Subject: [Openroad-users] GetFileTime (or FindFirstFile) WindowsAPI

	Hi,

	Since the wise readers of this list managed to explain how to use GetLocalTime a while ago, I was wondering if anyone has a similar example of using GetFileTime or FindFirstFile (http://msdn.microsoft.com/en-us/library/aa364418(VS.85).aspx <http://msdn.microsoft.com/en-us/library/aa364418(VS.85).aspx>  ) to get the timestamps of a file. How can structures like WIN32_FIND_DATA, FILETIME and SYSTEMTIME be handled in OpenROAD (4.1) ?

	Or is there an easier way to get the timestamps of a file?

	Rune Randøy

	Senior Consultant, Application Architecture

	Aker Solutions

	Kristiansand, Norway

	
	This e-mail and any attachment are confidential and may be privileged or otherwise protected from disclosure. It is solely intended for the person(s) named above. If you are not the intended recipient, any reading, use, disclosure, copying or distribution of all or parts of this e-mail or associated attachments is strictly prohibited. If you are not an intended recipient, please notify the sender immediately by replying to this message or by telephone and delete this e-mail and any attachments permanently from your system. 
	This message has been checked for all known viruses on behalf of SunGard Public Sector by MessageLabs. 
	
	http://www.messagelabs.com or Email: mailsweeper.info at vivista.sungard.com
	
	For further information http://www.sungardps.co.uk

**********************************************************************

SunGard Public Sector Limited, Marshfield, Chippenham, Wiltshire  SN14 8SR
Telephone: 08456 041999,  Fax: 08456 052999

Registered Office:  33 St Mary Axe, London EC3A 8AA.  Registered in England No.
1593831 VAT Reg No. GB 810 9546 34

**********************************************************************

CONFIDENTIALITY: This e-mail (including any attachments) may contain confidential, proprietary and privileged information, and is intended solely for the use of the individual or entity to whom they

are addressed. Any unauthorized disclosure or use is prohibited. If you received this e-mail in error, please notify the sender and delete this e-mail from your system.

**********************************************************************


This message has been checked for all known viruses on behalf of SunGard Public Sector by MessageLabs. 

http://www.messagelabs.com or Email: mailsweeper.info at vivista.sungard.com

For further information http://www.sungardps.co.uk



This e-mail and any attachment are confidential and may be privileged or otherwise protected from disclosure. It is solely intended for the person(s) named above. If you are not the intended recipient, any reading, use, disclosure, copying or distribution of all or parts of this e-mail or associated attachments is strictly prohibited. If you are not an intended recipient, please notify the sender immediately by replying to this message or by telephone and delete this email and any attachments permanently from your system.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.peerlessit.com/pipermail/openroad-users/attachments/20080604/3482ac36/attachment.html 


More information about the Openroad-users mailing list