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.
In message <9a3486b458.graham@graham.durain.uk>
Graham Pickles <graham@durain.uk> 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.
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
HostFS::HardDisc4.$.Deposits.Trial (ii) if not to establish an
empty directory entitled Trial at that location
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.
In message <9a3486b458.graham@graham.durain.uk> Graham Pickles
<graham@durain.uk> 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.
In article <532e8fb458.Alan.Adams@ArmX6.adamshome.org.uk>, Alan
Adams
<alan@adamshome.org.uk> wrote:
In message <9a3486b458.graham@graham.durain.uk> Graham Pickles
<graham@durain.uk> 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
In message <58b4970e7fbasura@invalid.addr.uk>
Richard Ashbery <basura@invalid.addr.uk> wrote:
Yes, I think it is probably a bit wiser not to ignore the fact that the directory may already exist. My excuse is that I'm trying out an idea
and don't expect anyone else to use my program at present. If my idea is successful then I will revamp to make it as a proper fully thought out program unlikely to mislead others or myself in the future!
Thanks for the info. Have not used SYS "OS_File",17 before.
Regards,
Indeed, in some cases it might be necessary to distinguish between three possibilities:
No directory exists
Empty directory exists
Directory exists and has contents. For this one I *think* it's possible to search for a file called * in the directory.
Alan Adams <alan@adamshome.org.uk> wrote:
Indeed, in some cases it might be necessary to distinguish between three possibilities:
No directory exists
Empty directory exists
Directory exists and has contents. For this one I *think* it's possible to search for a file called * in the directory.
Plus 'exists and it's a file' and 'exists and it's an image file'.
(it's a common corner case to do unexpected things when it's of the wrong type, and image files additionally muddy the waters)
Theo
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 60:23:51 |
Calls: | 6,654 |
Calls today: | 6 |
Files: | 12,200 |
Messages: | 5,331,392 |