An open question - OS2

This is a discussion on An open question - OS2 ; I am having some problems with open. With a NFS mounted directory that has the enforce case set, then trying open or fopen a fille named "Foo.bar" as "foo.bar" fails - As expected - However, many other prgrams such as ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 21

Thread: An open question

  1. An open question

    I am having some problems with open. With a NFS mounted directory that
    has the enforce case set, then trying open or fopen a fille named
    "Foo.bar" as "foo.bar" fails - As expected - However, many other
    prgrams such as E, EPM, vi, cat, ls, etc. *can* open it with no
    trouble. So how do they do that then?

    Would this be similar to the problem poor old Describe has in that it
    barfs if pointed at a shared drive? I would have thought that a file
    was a file and anything odd about it such as "file & print" or NFS
    specifics would be handled much lower down the food chain than open.

    TIA
    --
    Regards
    Dave Saville

    NB Remove nospam. for good email address

  2. Re: An open question

    On Sun, 4 May 2008 15:14:31 UTC in comp.os.os2.programmer.misc, "Dave Saville"
    wrote:

    > Would this be similar to the problem poor old Describe has in that it
    > barfs if pointed at a shared drive?


    I think Describe did it deliberately - you had to pay extra for a LAN enabled
    version!

    --
    Trevor Hemsley, Brighton, UK
    Trevor dot Hemsley at ntlworld dot com

  3. Re: An open question

    On 04 May 2008 15:14:31 GMT, Dave Saville wrote:

    > I am having some problems with open. With a NFS mounted directory that
    > has the enforce case set, then trying open or fopen a fille named
    > "Foo.bar" as "foo.bar" fails - As expected - However, many other
    > prgrams such as E, EPM, vi, cat, ls, etc. *can* open it with no
    > trouble. So how do they do that then?
    >
    > Would this be similar to the problem poor old Describe has in that it
    > barfs if pointed at a shared drive? I would have thought that a file
    > was a file and anything odd about it such as "file & print" or NFS
    > specifics would be handled much lower down the food chain than open.


    OS2TRACE is your friend.

  4. Re: An open question

    On Sun, 4 May 2008 17:07:23 UTC, "Trevor Hemsley"
    wrote:

    > On Sun, 4 May 2008 15:14:31 UTC in comp.os.os2.programmer.misc, "Dave Saville"
    > wrote:
    >
    > > Would this be similar to the problem poor old Describe has in that it
    > > barfs if pointed at a shared drive?

    >
    > I think Describe did it deliberately - you had to pay extra for a LAN enabled
    > version!
    >


    Interesting ... and daft. I can understand doing that if one was
    running a program centrally and having multiple access from other
    boxes - Faxworks for example. But this would be the other way around,
    a remote program getting data centrally. But then ISTR that the owner
    of Describe was a bit, err odd. :-) (BTW the non LAN version of
    Faxworks works in a LAN if you export the fax directory. Faxes sent by
    other boxes don't get sent at once, but they do get sent.)

    Now if someone can explain the open problem...........

    --
    Regards
    Dave Saville

    NB Remove nospam. for good email address

  5. Re: An open question

    On 04 May 2008 18:19:00 GMT, Dave Saville wrote:

    >> I think Describe did it deliberately - you had to pay extra for a LAN enabled
    >> version!

    >
    > Interesting ... and daft. I can understand doing that if one was
    > running a program centrally and having multiple access from other
    > boxes


    The author of (DOS utility) LIST did this as well. I just patched out the
    network drive check. Ha!

  6. Re: An open question

    In , on 05/04/2008
    at 03:14 PM, "Dave Saville" said:

    >I am having some problems with open. With a NFS mounted directory that
    >has the enforce case set, then trying open or fopen a fille named
    >"Foo.bar" as "foo.bar" fails - As expected - However, many other prgrams
    >such as E, EPM, vi, cat, ls, etc. *can* open it with no trouble. So how
    >do they do that then?


    As other's have noted os2trace will tell you what the other apps are
    doing. On possibility is that these apps do a DosFindFirst and uses the
    returned file name which will have the proper case.

    Steven

    --
    --------------------------------------------------------------------------------------------
    Steven Levine MR2/ICE 3.00 beta 11pre9 #10183
    eCS/Warp/DIY/14.103a_W4 www.scoug.com irc.ca.webbnet.info #scoug (Wed 7pm PST)
    --------------------------------------------------------------------------------------------


  7. Re: An open question

    On Mon, 5 May 2008 00:02:48 UTC, Paul Ratcliffe
    wrote:

    > On 04 May 2008 18:19:00 GMT, Dave Saville wrote:
    >
    > >> I think Describe did it deliberately - you had to pay extra for a LAN enabled
    > >> version!

    > >
    > > Interesting ... and daft. I can understand doing that if one was
    > > running a program centrally and having multiple access from other
    > > boxes

    >
    > The author of (DOS utility) LIST did this as well. I just patched out the
    > network drive check. Ha!


    Out of interest, how does one do the check?

    --
    Regards
    Dave Saville

    NB Remove nospam. for good email address

  8. Re: An open question

    On Sun, 4 May 2008 18:16:23 UTC, Paul Ratcliffe
    wrote:

    > OS2TRACE is your friend.


    Well, I don't need any enemies then. :-) I thought truss was bad
    enough, but that looks like a classic case of needing to know the
    answer before you start looking for it. A whole inf book on OS2TRACE
    and not a single example. :-( The command ref on trace is no help
    either.

    --
    Regards
    Dave Saville

    NB Remove nospam. for good email address

  9. Re: An open question

    On Mon, 5 May 2008 00:02:48 UTC, Paul Ratcliffe
    wrote:

    > The author of (DOS utility) LIST did this as well. I just patched out the
    > network drive check. Ha!


    Could we do that to Describe?
    --
    Regards
    Dave Saville

    NB Remove nospam. for good email address

  10. Re: An open question

    On Mon, 5 May 2008 07:14:48 UTC, "Dave Saville"
    wrote:

    > On Mon, 5 May 2008 00:02:48 UTC, Paul Ratcliffe
    > wrote:
    >
    > > On 04 May 2008 18:19:00 GMT, Dave Saville wrote:
    > >
    > > >> I think Describe did it deliberately - you had to pay extra for a LAN enabled
    > > >> version!
    > > >
    > > > Interesting ... and daft. I can understand doing that if one was
    > > > running a program centrally and having multiple access from other
    > > > boxes

    > >
    > > The author of (DOS utility) LIST did this as well. I just patched out the
    > > network drive check. Ha!

    >
    > Out of interest, how does one do the check?


    I don't know if there's a flag somewhere, but a check on the file system
    in use (say LAN of NFS) would be easy enough. For example, look at the
    output from my implementation of DF to see what you get:

    http://www.tavi.co.uk/os2pages/df.html



  11. Re: An open question

    [A complimentary Cc of this posting was sent to
    Dave Saville
    ], who wrote in article :
    > On Sun, 4 May 2008 18:16:23 UTC, Paul Ratcliffe
    > wrote:
    >
    > > OS2TRACE is your friend.

    >
    > Well, I don't need any enemies then. :-) I thought truss was bad
    > enough, but that looks like a classic case of needing to know the
    > answer before you start looking for it. A whole inf book on OS2TRACE
    > and not a single example. :-( The command ref on trace is no help
    > either.


    If you needed help, why wait until the 3rd suggestion of os2trace???

    Attached is my HOWTO-os2trace. (You may want to copy the executable
    to a separate directory - IIRC, it is edited.)

    Hope this helps,
    Ilya

    ================================================== =====
    Customize tracing to log the most information possible
    (Case-insensitive)
    os2trace -a none -b 96 -c off -d all -e off -f all -g all -i on -l 3 -t off -u none -w all
    -E off - no ebcdic tracing
    -b all - all bytes from buffers
    -t on - write timestamps
    Enable the executable file to trace APIs from all of the supported DLLs
    os2trace -on -all %1.exe
    Disable the executable file from tracing
    os2trace -off -all %1.exe

  12. Re: An open question

    On Mon, 5 May 2008 09:10:36 UTC, Ilya Zakharevich
    wrote:

    > If you needed help, why wait until the 3rd suggestion of os2trace???
    >


    Maybe because they were all posted yesterday and I did not read them
    until today?

    > Attached is my HOWTO-os2trace. (You may want to copy the executable
    > to a separate directory - IIRC, it is edited.)
    >
    > Hope this helps,
    > Ilya
    >
    > ================================================== =====
    > Customize tracing to log the most information possible
    > (Case-insensitive)
    > os2trace -a none -b 96 -c off -d all -e off -f all -g all -i on -l 3 -t off -u none -w all
    > -E off - no ebcdic tracing
    > -b all - all bytes from buffers
    > -t on - write timestamps
    > Enable the executable file to trace APIs from all of the supported DLLs
    > os2trace -on -all %1.exe
    > Disable the executable file from tracing
    > os2trace -off -all %1.exe


    Well thanks for that, but there is *no* command called os2trace* on my
    ECS system. There is a os2trace.inf file but that is talking about the
    TRACE command.

    --
    Regards
    Dave Saville

    NB Remove nospam. for good email address

  13. Re: An open question

    Ahah - The murk clears. Nobody mentioned that OS2TRACE was an add-on.
    What confused me was that I had not heard of it and did an OS2 help
    file search and turned up c:\os2\book\os2trace.inf - Which confirmed,
    to me, that it was part od ECS. So my comments previously were WRT to
    TRACE and friends.

    So, to get back to my original problem, I traced e and it just does
    dos32open.............


    --
    Regards
    Dave Saville

    NB Remove nospam. for good email address

  14. Re: An open question

    On 05 May 2008 07:14:48 GMT, Dave Saville wrote:

    >> >> I think Describe did it deliberately - you had to pay extra for a LAN enabled
    >> >> version!
    >> >
    >> > Interesting ... and daft. I can understand doing that if one was
    >> > running a program centrally and having multiple access from other
    >> > boxes

    >>
    >> The author of (DOS utility) LIST did this as well. I just patched out the
    >> network drive check. Ha!

    >
    > Out of interest, how does one do the check?


    The app. used AX=4409 to INT 21 call and checked bit 12 of the return value in
    DX. I just changed the conditional jump (JZ) to a non-conditional jump (JMP).
    It was a single byte patch in two locations in the file.

    I also patched it to change the Desqview 'give up timeslice' function to the
    OS/2 'give up timeslice' function. Worked much better in a VDM after that.

    If you are asking how you check under OS/2, then you call DosQueryHType()
    and look at bit 15 of the pType variable returned.

  15. Re: An open question

    On 05 May 2008 08:40:01 GMT, Dave Saville wrote:

    > On Mon, 5 May 2008 00:02:48 UTC, Paul Ratcliffe
    > wrote:
    >
    >> The author of (DOS utility) LIST did this as well. I just patched out the
    >> network drive check. Ha!

    >
    > Could we do that to Describe?


    Probably, depending how much work it is to find where it is, although because
    OS/2 system calls work in different way to DOS calls it might be easier to
    do it using a forwarder DLL to intercept the DosQueryHType() call rather than
    to use a patch.
    I've used both techniques, depending....

    I don't have a copy though, so unless someone wants to send me one I can't
    advise any further.

  16. Re: An open question

    In , on 05/05/2008
    at 10:22 AM, "Dave Saville" said:

    Hi,

    >So, to get back to my original problem, I traced e and it just does
    >dos32open.............


    And your code does what and with what flags?

    os2trace does very good reporting of input and output parameters. The
    trace facility is handy because it is less intrusive, but the output is
    not as easy to use.

    Steven

    --
    --------------------------------------------------------------------------------------------
    Steven Levine MR2/ICE 3.00 beta 11pre9 #10183
    eCS/Warp/DIY/14.103a_W4 www.scoug.com irc.ca.webbnet.info #scoug (Wed 7pm PST)
    --------------------------------------------------------------------------------------------


  17. Re: An open question

    On Mon, 5 May 2008 17:02:54 UTC, Steven Levine
    wrote:

    > In , on 05/05/2008
    > at 10:22 AM, "Dave Saville" said:
    >
    > Hi,
    >
    > >So, to get back to my original problem, I traced e and it just does
    > >dos32open.............

    >
    > And your code does what and with what flags?
    >
    > os2trace does very good reporting of input and output parameters. The
    > trace facility is handy because it is less intrusive, but the output is
    > not as easy to use.


    #include "errno.h"
    #include "strings.h"
    #include "fcntl.h"

    int main(int argc, char**argv)
    {
    open("H:/home/DB/Clipprocess", O_RDONLY);
    printf("Return from file open: %s", strerror(errno));
    }

    The second p in the filename should be P and if it is, open returns
    "no error" when H is NFS mounted from an OS/2 box with enforce case.
    As it is coded it returns "file not found". But E, EPM, Vi et al can
    all open it regardless of the case typed in the command line. I can
    see no documented flags to open, or fopen which acts the same, WRT to
    case.

    Incidently, how do I compile a program such that os2trace works? Just
    running the above through GCC and pointing os2trace at the resulting
    exe reports it can't trace anything.
    --
    Regards
    Dave Saville

    NB Remove nospam. for good email address

  18. Re: An open question

    > #include "errno.h"
    > #include "strings.h"
    > #include "fcntl.h"
    >
    > int main(int argc, char**argv)
    > {
    > open("H:/home/DB/Clipprocess", O_RDONLY);
    > printf("Return from file open: %s", strerror(errno));
    > }
    >
    > The second p in the filename should be P and if it is, open returns
    > "no error" when H is NFS mounted from an OS/2 box with enforce case.


    Just a wild guess. Did you try it with backslash separator?

    open("H:\\home\\DB\\Clipprocess", O_RDONLY);

    Slash seems to work in most cases but AFAIK this is not guaranteed
    for all filesystems. The TK DOS ref explicitly states that for FAT
    and HPFS only \ is allowed (even though / seems to work).

    I could imagine that the NFS IFS driver handles this differently.
    Maybe it cares about / (case sensitive) and \ (FAT/HPFS/JFS compatible
    case insensitive). It could be intended or just some leftover from a AIX
    backport? Isn't there an OS/2 NFS reference?

    Regarding enforce case option, AFAIK this only applies for file creation
    or renaming but not for open. That's why you can't have x.txt in the same
    directory as X.txt on an OS/2 filesystem. But this is legal on Linux/Unix
    filesystems and so I could imagine IBM implemented a way in NFS IFS to
    allow applications to access these individual files despite the usually
    case insensitive open.

  19. Re: An open question

    In , on 05/05/2008
    at 05:28 PM, "Dave Saville" said:

    Hi,

    >Incidently, how do I compile a program such that os2trace works?


    Os2trace will work with any LX executable, AFAIK.

    >Just
    >running the above through GCC and pointing os2trace at the resulting exe
    >reports it can't trace anything.


    You need to tell os2trace to patch your executables. A couple of seconds
    with OS2TRACE.DOC and OS2TRACE.FAQ should get you started.

    If you somehow managed to download and anitique version, you should be
    using v2.45.36 (03 Dec 03)


    Steven

    --
    --------------------------------------------------------------------------------------------
    Steven Levine MR2/ICE 3.00 beta 11pre9 #10183
    eCS/Warp/DIY/14.103a_W4 www.scoug.com irc.ca.webbnet.info #scoug (Wed 7pm PST)
    --------------------------------------------------------------------------------------------


  20. Re: An open question

    On Tue, 6 May 2008 01:23:29 UTC, Steven Levine
    wrote:

    > In , on 05/05/2008
    > at 05:28 PM, "Dave Saville" said:
    >
    > Hi,
    >
    > >Incidently, how do I compile a program such that os2trace works?

    >
    > Os2trace will work with any LX executable, AFAIK.


    Operating System/2 API Trace
    Version 2.45.36 (03 Dec 2003)
    (c) Copyright IBM Corporation 1995, 2003.

    try.exe (LX Executable File) -
    DOSCALLS: File does not import from DLL, API tracing not enabled
    HELPMGR : File does not import from DLL, API tracing not enabled
    KBDCALLS: File does not import from DLL, API tracing not enabled
    MONCALLS: File does not import from DLL, API tracing not enabled
    MOUCALLS: File does not import from DLL, API tracing not enabled
    MSG : File does not import from DLL, API tracing not enabled
    NAMPIPES: File does not import from DLL, API tracing not enabled
    NLS : File does not import from DLL, API tracing not enabled
    PMBIDI : File does not import from DLL, API tracing not enabled
    PMCTLS : File does not import from DLL, API tracing not enabled
    PMDRAG : File does not import from DLL, API tracing not enabled
    PMGPI : File does not import from DLL, API tracing not enabled
    PMMERGE : File does not import from DLL, API tracing not enabled
    PMPIC : File does not import from DLL, API tracing not enabled
    PMSHAPI : File does not import from DLL, API tracing not enabled
    PMSPL : File does not import from DLL, API tracing not enabled
    PMVIOP : File does not import from DLL, API tracing not enabled
    PMWIN : File does not import from DLL, API tracing not enabled
    PMWP : File does not import from DLL, API tracing not enabled
    QUECALLS: File does not import from DLL, API tracing not enabled
    SESMGR : File does not import from DLL, API tracing not enabled
    VIOCALLS: File does not import from DLL, API tracing not enabled
    Return from file open: No such file or directory

    So open does not isssue a doscall?

    --
    Regards
    Dave Saville

    NB Remove nospam. for good email address

+ Reply to Thread
Page 1 of 2 1 2 LastLast