i want to know how to get the date (modified only)
and any attibutes the file had
and is it possible to set these?
			
			
									
									File dates and attributes
File dates and attributes
~Dreglor
						- 
				AlGonzalez
 - User

 - Posts: 53
 - Joined: Sun Feb 15, 2004 6:04 am
 - Location: Easley, SC, USA
 
For date information, look into the "GetFileTime_" and "FileTimeToSystemTime" Windows API calls.
Get/Set Attributes:
You may also want to look at the "DirectoryEntryAttributes" command.
HTH
			
			
									
									
						Get/Set Attributes:
Code: Select all
Procedure.s ShowFileAttributes(file.s)
    Protected result.l, attribs.s
    
    result = GetFileAttributes_(file)
    attribs.s = ""
    If result & #FILE_ATTRIBUTE_DIRECTORY 
        attribs + "D"
    EndIf
    If result & #FILE_ATTRIBUTE_COMPRESSED 
        attribs + "C"
    EndIf
    If result & #FILE_ATTRIBUTE_READONLY 
        attribs + "R"
    EndIf
    If result & #FILE_ATTRIBUTE_ARCHIVE 
        attribs + "A"
    EndIf
    If result & #FILE_ATTRIBUTE_SYSTEM
        attribs + "S"
    EndIf
    If result & #FILE_ATTRIBUTE_HIDDEN 
        attribs + "H"
    EndIf
    
    ProcedureReturn attribs
EndProcedure
fn.s = "C:\selects.txt"
Debug ShowFileAttributes(fn)  ; result A
SetFileAttributes_(fn, #FILE_ATTRIBUTE_READONLY | #FILE_ATTRIBUTE_ARCHIVE | #FILE_ATTRIBUTE_SYSTEM | #FILE_ATTRIBUTE_HIDDEN)
Debug ShowFileAttributes(fn)  ; result RASH
SetFileAttributes_(fn, #FILE_ATTRIBUTE_ARCHIVE)
Debug ShowFileAttributes(fn)  ; result AHTH
