7m…ôcUm \cd….REM Subject: Re: File Attrib probs with call($887... on S5REM Date: Tue, 23 Mar 1999 23:35 +0000 (GMT Standard Time)REM From: hzk@cix.co.uk (Roger Muggleton)REM Reply-To: nospam@pleaseREM Organization: CIX - Compulink Information eXchangeREM Newsgroups: comp.sys.psion.programmerREM In article <7d7pu0$hij$1@nnrp1.dejanews.com>, benhalliday@my-dejanews.comREM () wrote:REM > I dont suppose anyone has examples of the SYSTEM.OPX code?REM No problem. Here is some code from 3T which shows how to get the Hidden,REM System and ReadOnly attributes, and the file datestamp. It also shows howREM to change these.REM System.opx does not have a function to change the Archive attribute. IREM can't remember seeing any OPX which has this.REM Firstly make sure that you declare the built-in OPXs required at the topREM of your program:INCLUDE "system.oxh"INCLUDE "date.oxh"INCLUDE "sysinfo.oxh"REM Then call the following procedure like:PROC start: GetDetails:("D:\phymod")ENDPPROC GetDetails:(Filename$) LOCAL size$(50) LOCAL ro%,hi%,sys%,fold%,yr%,mo%,day%,hr%,min%,sec%,yd% LOCAL year&,month&,day&,hour&,minute&,second&,micro& LOCAL DTid&,secs&,d&,t& DTid&=dtnow&: GETFILETIME:(filename$,DTid&) yr%=DTYear&:(DTid&) mo%=DTmonth&:(DTid&) day%=DTday&:(DTid&) hr%=DThour&:(DTid&) min%=DTminute&:(DTid&) sec%=DTsecond&:(DTid&) secs&=DATETOSECS(yr%,mo%,day%,hr%,min%,sec%) d&=DAYS(day%,mo%,yr%) t&=DATETOSECS(1970,1,1,hr%,min%,sec%) size$=fsize$:(filename$) ro%=IsReadOnly&:(filename$) hi%=IsHidden&:(filename$) sys%=IsSystem&:(filename$) dINIT "Properties" dDATE d&,"Date",DAYS(1,1,1980),DAYS(1,1,2038) dTIME t&,"Time",1,0,86399 dTEXT "Size:",size$ dCHECKBOX ro%,"Read Only" dCHECKBOX hi%,"Hidden file" dCHECKBOX sys%,"System file" dBUTTONS "Leave",-(%l OR $300),"Change",%c OR $300 IF dIALOG=0 RETURN ENDIF gIPRINT "Updating file properties" d&=(d&-25567)*86400 REM date as seconds after 1/1/70 d&=d&+t& REM add seconds SECSTODATE d&,yr%,mo%,day%,hr%,min%,sec%,yd% year&=yr% :DTSETYEAR:(DTid&,year&) month&=mo% :DTSETMONTH:(DTid&,month&) day&=day% :DTSETDAY:(DTid&,day&) hour&=hr% :DTSETHOUR:(DTid&,hour&) minute&=min% :DTSETMINUTE:(DTid&,minute&) second&=sec% :DTSETSECOND:(DTid&,second&) DTSETMICRO:(DTid&,0) SETFILETIME:(filename$,DTid&) SetReadOnly:(filename$,ABS(ro%)) SetHiddenFile:(filename$,ABS(hi%)) SetSystemFile:(filename$,ABS(sys%))ENDPREM I've chopped this out of 3T and removed/changed some irrelevent bits, andREM in the best usenet tradition I haven't tested it! Email me if you have anyREM problems.REM RogerREM http://www.cix.co.uk/~hzk/ÐР   \cÇ efd\cÏ efdý‚.ÆA…*TextEd.app…× ‰^