Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File Dates....

Status
Not open for further replies.

thekl0wn

Programmer
Jan 12, 2006
292
US
Simple coding to get the last modified date of a file. I know this works in PB10.5, but I don't see why it wouldn't work in older versions. There are many other options using the OLEObjects like this like size, etc. I find it works best to create a UserObject for this.

String ls_filepath //The full path of the file
OLEObject obj_shell, obj_folder, obj_item
DateTime ldt_last_mod

obj_shell = CREATE OleObject
obj_shell.ConnectToNewObject("Shell.Application")
obj_folder = obj_shell.NameSpace( ls_filepath )

IF IsValid( obj_folder ) THEN
obj_item = obj_folder.ParseName( is_filename )
IF IsValid( obj_item ) THEN
ldt_last_mod = obj_item.ModifyDate
END IF
END IF

SetNull( obj_shell )
SetNull( obj_folder )
SetNull( obj_item )

Let me know if there are any questions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top