• SYS "XOS_Find",&80

    From Paul Stewart@phorefaux@gmail.com to comp.sys.acorn.programmer on Tue Dec 30 22:36:08 2025
    From Newsgroup: comp.sys.acorn.programmer

    Hi all,

    Hoping someone can help point out my mistake.
    Issue with SYS"XOS_Find",&80.

    Using SYS "XOS_Find",&80 to create a file, which is working fine.
    Just trying to trap errors when it is unable to create the file.
    Before I create the file I am using OS_File 17 to check if it exists
    first, which again is working okay.

    My bit of code is:
    SYS "XOS_Find",&80,fname$ TO fhandle%;flags%
    IF (flags% AND 1)<>0 SYS "OS_GenerateError",fhandle%

    If I then try an save to say a readonly ShareFS share, it generates
    expected error:

    30 Dec 22:16:12 100 Message : Shared disc is read only at line 157

    This I can trap and program continues to function.

    If I try an save to Resources (yes I know it is readonly and nobody should
    be attempting to save to it, but just for completeness) I receive the following error:


    30 Dec 22:08:05 100 Message : Internal error: abort on instruction
    fetch at &2

    With this error the program dies directly after running SYS "XOS_Find",&80,fname$ TO fhandle%;flags%
    --
    Paul Stewart
    Sent from A9home running RISC OS 4.42
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Martin@News04@avisoft.f9.co.uk to comp.sys.acorn.programmer on Tue Dec 30 23:33:46 2025
    From Newsgroup: comp.sys.acorn.programmer

    In article <662a8a935c.Paul@phorefaux>,
    Paul Stewart <phorefaux@gmail.com> wrote:
    Hi all,

    Hoping someone can help point out my mistake.
    Issue with SYS"XOS_Find",&80.

    Using SYS "XOS_Find",&80 to create a file, which is working fine.
    Just trying to trap errors when it is unable to create the file.
    Before I create the file I am using OS_File 17 to check if it exists
    first, which again is working okay.

    My bit of code is:
    SYS "XOS_Find",&80,fname$ TO fhandle%;flags%
    IF (flags% AND 1)<>0 SYS "OS_GenerateError",fhandle%

    If I then try an save to say a readonly ShareFS share, it generates
    expected error:

    30 Dec 22:16:12 100 Message : Shared disc is read only at line
    157

    This I can trap and program continues to function.

    If I try an save to Resources (yes I know it is readonly and nobody
    should be attempting to save to it, but just for completeness) I
    receive the following error:


    30 Dec 22:08:05 100 Message : Internal error: abort on
    instruction fetch at &2

    With this error the program dies directly after running SYS "XOS_Find",&80,fname$ TO fhandle%;flags%

    Using RISC OS 5.31 on a Titanium, I get the expected
    Error : &00000113
    Message: The filing system Resources: is read only

    Maybe an old bug in RISC OS 4.42?
    --
    Martin Avison
    Note that unfortunately this email address will become invalid
    without notice if (when) any spam is received.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Paul Stewart@phorefaux@gmail.com to comp.sys.acorn.programmer on Tue Dec 30 23:57:20 2025
    From Newsgroup: comp.sys.acorn.programmer

    In message <5c938f708eNews04@avisoft.f9.co.uk>
    Martin <News04@avisoft.f9.co.uk> wrote:

    In article <662a8a935c.Paul@phorefaux>,
    Paul Stewart <phorefaux@gmail.com> wrote:
    Hi all,

    Hoping someone can help point out my mistake.
    Issue with SYS"XOS_Find",&80.

    Using SYS "XOS_Find",&80 to create a file, which is working fine.
    Just trying to trap errors when it is unable to create the file.
    Before I create the file I am using OS_File 17 to check if it exists
    first, which again is working okay.

    My bit of code is:
    SYS "XOS_Find",&80,fname$ TO fhandle%;flags%
    IF (flags% AND 1)<>0 SYS "OS_GenerateError",fhandle%

    If I then try an save to say a readonly ShareFS share, it generates
    expected error:

    30 Dec 22:16:12 100 Message : Shared disc is read only at line
    157

    This I can trap and program continues to function.

    If I try an save to Resources (yes I know it is readonly and nobody
    should be attempting to save to it, but just for completeness) I
    receive the following error:


    30 Dec 22:08:05 100 Message : Internal error: abort on
    instruction fetch at &2

    With this error the program dies directly after running SYS
    "XOS_Find",&80,fname$ TO fhandle%;flags%

    Using RISC OS 5.31 on a Titanium, I get the expected
    Error : &00000113
    Message: The filing system Resources: is read only

    Maybe an old bug in RISC OS 4.42?

    Didn't think about that. Assumed it was me!

    I'll try it on my Pinebook and see what happens.
    --
    Paul Stewart
    Sent from A9home running RISC OS 4.42
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Paul Stewart@phorefaux@gmail.com to comp.sys.acorn.programmer on Wed Dec 31 13:16:51 2025
    From Newsgroup: comp.sys.acorn.programmer

    In message <5c938f708eNews04@avisoft.f9.co.uk>
    Martin <News04@avisoft.f9.co.uk> wrote:

    In article <662a8a935c.Paul@phorefaux>,
    Paul Stewart <phorefaux@gmail.com> wrote:
    Hi all,

    Hoping someone can help point out my mistake.
    Issue with SYS"XOS_Find",&80.

    Using SYS "XOS_Find",&80 to create a file, which is working fine.
    Just trying to trap errors when it is unable to create the file.
    Before I create the file I am using OS_File 17 to check if it exists
    first, which again is working okay.

    My bit of code is:
    SYS "XOS_Find",&80,fname$ TO fhandle%;flags%
    IF (flags% AND 1)<>0 SYS "OS_GenerateError",fhandle%

    If I then try an save to say a readonly ShareFS share, it generates
    expected error:

    30 Dec 22:16:12 100 Message : Shared disc is read only at line
    157

    This I can trap and program continues to function.

    If I try an save to Resources (yes I know it is readonly and nobody
    should be attempting to save to it, but just for completeness) I
    receive the following error:


    30 Dec 22:08:05 100 Message : Internal error: abort on
    instruction fetch at &2

    With this error the program dies directly after running SYS
    "XOS_Find",&80,fname$ TO fhandle%;flags%

    Using RISC OS 5.31 on a Titanium, I get the expected
    Error : &00000113
    Message: The filing system Resources: is read only

    Maybe an old bug in RISC OS 4.42?
    Indeed it does appear to be a bug in 4.42. Works okay on my Pinebook and under RISC OS 6 on VRPC.
    --
    Paul Stewart
    Sent from A9home running RISC OS 4.42
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Paul Stewart@phorefaux@gmail.com to comp.sys.acorn.programmer on Wed Dec 31 13:43:36 2025
    From Newsgroup: comp.sys.acorn.programmer

    In message <2fccda935c.Paul@phorefaux>
    Paul Stewart <phorefaux@gmail.com> wrote:

    "XOS_Find",&80,fname$ TO fhandle%;flags%

    Using RISC OS 5.31 on a Titanium, I get the expected
    Error : &00000113
    Message: The filing system Resources: is read only

    Maybe an old bug in RISC OS 4.42?
    Indeed it does appear to be a bug in 4.42. Works okay on my Pinebook and under RISC OS 6 on VRPC.

    Before asking if anyone could recommend another way of doing this, I have looked up OS_File, which I am using to test if object exists.

    Have found this does the job ok:

    SYS"XOS_File",11,fname$,&dfe,,0 TO fhandle%;flags%

    Bit of code I am testing with: -

    ON ERROR PROCmessage_box(0,REPORT$+" at line "+STR$ ERL,2,"Test"):END fname$="resources:$.Export"
    REM fname$="CDFS::$.Export"
    REM fname$="Share::A9_Directory.$.Export": REM read only
    REM fname$="Mem::MemphisA9.$.Export"

    REM this errors when attempting to write to resoucefs. Bug if 4.42
    REM SYS "XOS_Find",&80,fname$ TO fhandle%;flags%
    REM

    SYS"XOS_File",11,fname$,&dfe,,0 TO fhandle%;flags%: REM create a file with filetype CSV (&dfe) that is 0 bytes in size
    IF (flags% AND 1)<>0 THEN
    errmess$=""
    addr%=4
    WHILE fhandle%?addr%<>0
    errmess$+=CHR$ fhandle%?addr%
    addr%+=1
    ENDWHILE
    PROCmessage_box(0, errmess$,2,"Test")
    ELSE
    REM MODE MODE: PRINT fhandle%
    ENDIF
    END
    :
    DEF PROCmessage_box(faultcode%,message$,type%,title$)
    REM
    REM response: 0 if no key click, 1 if OK selected, 2 if Cancel
    selected
    LOCAL fault%()
    DIM fault% 100
    !fault%=faultcode%
    $(fault%+4)=message$
    SYS"Wimp_ReportError",fault%,type%,title$ TO ,response%
    ENDPROC
    :
    --
    Paul Stewart
    Sent from A9home running RISC OS 4.42
    --- Synchronet 3.21a-Linux NewsLink 1.2