Guidance
指路人
g.yi.org
Guidance Forums / Rapid-Q Basic / filedate

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. filedate
#1171
Posted by: qmark 2004-03-02 18:07:35
how I can get the date of a file??

using filestream??

any idea would be appreciated

Message2. Re: filedate
#1173
Posted by: 2004-03-03 21:10:00
Use the Dir$ keyword

DIR$ SYSTEM Function Windows

--------------------------------------------------------------------------------
 
 A system function used to obtain the first/next file corresponding to a specified filespec.

Syntax: DIR$[(file-spec, attribute)]
FileName$ = DIR$("*.*", 0) '-- Get first file
FileName$ = DIR$ '-- Get next file

Details:
File-spec specifies a filename or path (which can include wildcards characters). Calling DIR$ with no parameters return additional filename matches. If no matches exist (or all matches have been exhausted), DIR$ returns an empty string. DIR$ returns all regular files as well as any special files specified in the attribute parameter.
Here are some valid file attributes, you can combine
them by using OR (ie. faReadOnly OR faDirectory)

&H1 = faReadOnly       &H8 = faVolumeID
&H2 = faHidden        &H10 = faDirectory
&H4 = faSysFile       &H20 = faArchive
                      &H3F = faAnyFile
To obtain additional information on the currently matched file, use the FileRec properties.
FileRec.FileName    - Returns Windows long file name
FileRec.ShortName   - Returns the short file name
FileRec.Date        - Returns the file date as a string
FileRec.Time        - Returns the file time as a string
FileRec.Size        - Returns the file size
FileRec.FileTime    - Returns the file time as an integer

You can use FileRec.FileTime to compare file times. So a newer file will have a FileTime greater than an older file. 
---------------------------------------------------------------------
 It can also be done using APIs like GetFileTime, FindFirstFile, ... but it's
will require more learning
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Tue 2024-4-23  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0