Thanks Jean for sharing your code!

The only problem is that it gets file attributes rather than file time.

I have a printed copy of an example from News2News, Inc. that uses the
GetFileTime function.  I am more concerned about whether the times are
reliable between Windows XP and 7 and whether there might be an
unforeseen gotcha or better approach to the problem.

Joe

On Tuesday, May 14, 2013 12:29 PM, Jean MAURICE wrote:
>
>Date: Tue, 14 May 2013 18:29:50 +0200
>From: Jean MAURICE
>To: [email protected]
>cc:
>Subject: Re: Access windows file attributes from VFP
>
>something like :
>
>   DECLARE INTEGER GetFileAttributes in win32api string @
>
>   FUNCTION file_int_properties && _GetFileAttributes
>     LPARAMETERS lpFileName AS string
>     LOCAL m.lnAttributs, lcAttributs
>
>     lnAttributs= GetFileAttributes(@m.lpFileName)
>     IF m.lnAttributs=-1
>       RETURN ''
>     ENDIF
>     lcAttributs=''
>     If BITAND(m.lnAttributs,1)=1 && FILE_ATTRIBUTE_READONLY
>       lcAttributs= m.lcAttributs+'R'
>     ENDIF
>     If BITAND(m.lnAttributs,2)=2 && FILE_ATTRIBUTE_HIDDEN
>       lcAttributs= m.lcAttributs+'H'
>     ENDIF
>     If BITAND(m.lnAttributs,4)=4 && FILE_ATTRIBUTE_SYSTEM
>       lcAttributs= m.lcAttributs+'S'
>     ENDIF
>     If BITAND(m.lnAttributs,16)=16 && FILE_ATTRIBUTE_DIRECTORY
>       lcAttributs= m.lcAttributs+'D'
>     ENDIF
>     If BITAND(m.lnAttributs,32)=32 && FILE_ATTRIBUTE_ARCHIVE
>       lcAttributs= m.lcAttributs+'A'
>     ENDIF
>     If BITAND(m.lnAttributs,128)=128 && FILE_ATTRIBUTE_NORMAL
>       lcAttributs= m.lcAttributs+'N'
>     ENDIF
>     If BITAND(m.lnAttributs,512)=512 && FILE_ATTRIBUTE_TEMPORARY
>       lcAttributs= m.lcAttributs+'T'
>     ENDIF
>     If BITAND(m.lnAttributs,2048)=2048 && FILE_ATTRIBUTE_COMPRESSED
>       lcAttributs= m.lcAttributs+'C'
>     ENDIF
>     RETURN m.lcAttributs
>   ENDFUNC && int_attributs_fichier
>
>In fact, I build a class (in a .prg) to 'translate' API calls about files and
>directories in VFP methods
>
>HTH
>The Foxil
>The Foxil
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to