Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Richard Ashbery Newsgroups: comp.sys.acorn.programmer Subject: Re: Basic - establishing a directory Date: Wed, 23 Sep 2020 18:00:05 +0100 Organization: None Lines: 31 Message-ID: <58b4970e7fbasura@invalid.addr.uk> References: <9a3486b458.graham@graham.durain.uk> <532e8fb458.Alan.Adams@ArmX6.adamshome.org.uk> X-Trace: individual.net QMnwVswWXJyCLRXl0rB3cQUorDY+jl7SatvyW07bbs4DL3oFeP X-Orig-Path: uwclub.net!richard.ashbery Cancel-Lock: sha1:MhwiijWS86Fo9fiU8Wwp4tv2bKc= User-Agent: Pluto/3.16 (RISC OS/5.27) NewsHound/v1.52-32 Xref: csiph.com comp.sys.acorn.programmer:6188 In article <532e8fb458.Alan.Adams@ArmX6.adamshome.org.uk>, Alan Adams wrote: > In message <9a3486b458.graham@graham.durain.uk> Graham Pickles > wrote: > > Computer System is on a Laptop Lenovo using RISCBOOKQUAD using > > Windows Pro 7. RISCOS 4.02. Programming in Basic. > > I want to WITHIN a Basic program (i) check whether a particular > > directory is present at for instance > > > > (ii) if not to establish an empty directory entitled Trial at > > that location HostFS::HardDisc4.$.Deposits.Trial > > Getting old aren't we all! Probably quite simple but for some > > reason it's eluding me. Can anyone produce suitable Basic or > > point me in the right direction. > > Sorry if this is really trivial. > *cdir HostFS::HardDisc4.$.Deposits.Trial will create it if it > doesn't exist, and doesn't error if it did exist. Its simpler but I do like a bit more information and is where... SYS "OS_File", 17, "SDFS::HardDisc0.$.mydir" TO type% comes into its own. SWI returns 0 if object can't be found. If object exists and returns 2 then its a directory and 1 if its a file. Richard