Subject: Re: File Attrib probs with call($887... on S5 Date: Tue, 23 Mar 1999 23:35 +0000 (GMT Standard Time) From: hzk@cix.co.uk (Roger Muggleton) Reply-To: nospam@please Organization: CIX - Compulink Information eXchange Newsgroups: comp.sys.psion.programmer In article <7d7pu0$hij$1@nnrp1.dejanews.com>, benhalliday@my-dejanews.com () wrote: > I dont suppose anyone has examples of the SYSTEM.OPX code? No problem. Here is some code from 3T which shows how to get the Hidden, System and ReadOnly attributes, and the file datestamp. It also shows how to change these. System.opx does not have a function to change the Archive attribute. I can't remember seeing any OPX which has this. Firstly make sure that you declare the built-in OPXs required at the top of your program: INCLUDE "system.oxh" INCLUDE "date.oxh" Then call the following procedure like: GetDetails:("C:\Documents\My file") PROC 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%)) ENDP I've chopped this out of 3T and removed/changed some irrelevent bits, and in the best usenet tradition I haven't tested it! Email me if you have any problems. Roger http://www.cix.co.uk/~hzk/