f



OSFIND on BBC Micro

Hi

I know this is primary a RISC OS group, but anyway..

I am working on a filetransfer tool for RISCOS and BBC Micro. The plan 
is to have drag n drop on my ARMX6, but for a start I prototype the RO 
side in basic.

On the beeb side I am using assembler. I can read the serial port 
without problems, but for some reason I cannot do anything with the 
filesystem functions. I keep getting channel on channel errors (ADFS). 
For example with OSFIND. If I put in a illegal filename I get zero as 
the channel , so that works as expected. But if the filename is legal 
I get the above error.

Is there anything special I need to do before file handling? I have 
followed the docs and can't find anything else than the function 
reference.

Michael

-- 
Sent from my ARMX6 RISC OS computer.
0
Michael
7/20/2016 9:23:07 AM
comp.sys.acorn.programmer 2499 articles. 0 followers. Post Follow

5 Replies
333 Views

Similar Articles

[PageSpeed] 33

On Wednesday, July 20, 2016 at 10:23:09 AM UTC+1, Michael Grunditz wrote:
> Hi
> 
> I know this is primary a RISC OS group, but anyway..
> 
> I am working on a filetransfer tool for RISCOS and BBC Micro. The plan 
> is to have drag n drop on my ARMX6, but for a start I prototype the RO 
> side in basic.
> 
> On the beeb side I am using assembler. I can read the serial port 
> without problems, but for some reason I cannot do anything with the 
> filesystem functions. I keep getting channel on channel errors (ADFS). 
> For example with OSFIND. If I put in a illegal filename I get zero as 
> the channel , so that works as expected. But if the filename is legal 
> I get the above error.
> 
> Is there anything special I need to do before file handling? I have 
> followed the docs and can't find anything else than the function 
> reference.
> 
> Michael
> 
> -- 
> Sent from my ARMX6 RISC OS computer.
Are you using OPENUP or OPENOUT? One requires a file to be present and one creates a file?
0
svrsig
7/20/2016 10:16:49 AM
In message <64bd347f-492a-48dd-88a0-5118eeb63420@googlegroups.com>
          svrsig <chris@svrsig.org> wrote:

> On Wednesday, July 20, 2016 at 10:23:09 AM UTC+1, Michael Grunditz wrote:
>> Hi
>> 
>> I know this is primary a RISC OS group, but anyway..
>> 
>> I am working on a filetransfer tool for RISCOS and BBC Micro. The plan
>> is to have drag n drop on my ARMX6, but for a start I prototype the RO
>> side in basic.
>> 
>> On the beeb side I am using assembler. I can read the serial port
>> without problems, but for some reason I cannot do anything with the
>> filesystem functions. I keep getting channel on channel errors (ADFS).
>> For example with OSFIND. If I put in a illegal filename I get zero as
>> the channel , so that works as expected. But if the filename is legal
>> I get the above error.
>> 
>> Is there anything special I need to do before file handling? I have
>> followed the docs and can't find anything else than the function
>> reference.
>> 
>> Michael
>> 
>> --
>> Sent from my ARMX6 RISC OS computer.
> Are you using OPENUP or OPENOUT? One requires a file to be present and
> one creates a file?
OPENOUT. According to the ADFS docs it should create a 64K file.

-- 
Sent from my ARMX6 RISC OS computer.
0
Michael
7/20/2016 5:31:01 PM
On Wednesday, July 20, 2016 at 6:31:01 PM UTC+1, Michael Grunditz wrote:
> In message <64bd347f-492a-48dd-88a0-5118eeb63420@googlegroups.com>
>           svrsig <chris@svrsig.org> wrote:
> 
> > On Wednesday, July 20, 2016 at 10:23:09 AM UTC+1, Michael Grunditz wrote:
> >> Hi
> >> 
> >> I know this is primary a RISC OS group, but anyway..
> >> 
> >> I am working on a filetransfer tool for RISCOS and BBC Micro. The plan
> >> is to have drag n drop on my ARMX6, but for a start I prototype the RO
> >> side in basic.
> >> 
> >> On the beeb side I am using assembler. I can read the serial port
> >> without problems, but for some reason I cannot do anything with the
> >> filesystem functions. I keep getting channel on channel errors (ADFS).
> >> For example with OSFIND. If I put in a illegal filename I get zero as
> >> the channel , so that works as expected. But if the filename is legal
> >> I get the above error.
> >> 
> >> Is there anything special I need to do before file handling? I have
> >> followed the docs and can't find anything else than the function
> >> reference.
> >> 
> >> Michael
> >> 
> >> --
> >> Sent from my ARMX6 RISC OS computer.
> > Are you using OPENUP or OPENOUT? One requires a file to be present and
> > one creates a file?
> OPENOUT. According to the ADFS docs it should create a 64K file.
> 
> -- 
> Sent from my ARMX6 RISC OS computer.
My recollection is that OPENOUT (from BASIC) in earlier versions of RISC OS actually used OPENUP and there was no OPENUP keyword.
0
svrsig
7/22/2016 8:25:14 AM
On 22/07/2016 09:25, svrsig wrote:
> My recollection is that OPENOUT (from BASIC) in earlier versions of RISC OS actually used OPENUP and there was no OPENUP keyword.

You are going back a long way there. IIRC that was a feature of the very 
first versions of BASIC 1 in the 0.9x versions of the ROM when the A&B 
launched in 1981, OPENUP has been there since BASIC 2 in OS1.20 from 
1982 onwards.

---druck
0
druck
7/22/2016 7:48:33 PM
Michael Grunditz wrote:
> On the beeb side I am using assembler. I can read the serial port 
> without problems, but for some reason I cannot do anything with the 
> filesystem functions. I keep getting channel on channel errors (ADFS). 
> For example with OSFIND. If I put in a illegal filename I get zero as 
> the channel, so that works as expected. But if the filename is legal 
> I get the above error.

Without seeing some example code it's difficult to diagnose your
problems.

LDX #filename AND 255
LDY #filename DIV 256
LDA #&80
JSR OSFIND
.....
..filename
EQUS "filename":EQUB 13

will open 'filename' for output, overwriting any existing 'filename',
creating an empty 'filename' if none exists, returning A=handle, or
generating an error if 'filename' is malformed, or 'filename' exists
and is locked or a directory, or is already open.

The size of the newly-created file is filing system dependent, DFS
creates a 16K file, ADFS creates a 64K file. If you know how big the
file will eventually be, it is good practice to create the file
first and then OPENOUT on top of it, eg
SAVE "filename" 0+min(expectedsize,&B000)
OPENOUT "filename"

jgh
0
jgh
7/24/2016 9:25:35 AM
Reply: