Board index » delphi » Run-time error 150

Run-time error 150

Hi!

I'm converting an app from TP 5.0 to TP 7.01. The application uses BTree
Filer wich also has been upgraded.
It has been running under Netware in multiuser mode for years, now we
want it to run under NT 4.0 and that's the reason for rewriting the
application. Now when I'm testing I can start copy one on one machine
but when I start copy two on another I get Run-time 150, Disk is write
protected? Anyone who can point me in any direction where I've done
wrong?

TIA,
Stefan

 

Re:Run-time error 150


On Fri, 23 Jan 1998 12:19:45 +0100, Stefan Andersson <s...@algonet.se>
wrote:

Quote
> I'm converting an app from TP 5.0 to TP 7.01. The application uses BTree
> Filer wich also has been upgraded.
> It has been running under Netware in multiuser mode for years, now we
> want it to run under NT 4.0 and that's the reason for rewriting the
> application. Now when I'm testing I can start copy one on one machine
> but when I start copy two on another I get Run-time 150, Disk is write
> protected? Anyone who can point me in any direction where I've done
> wrong?

Look this over on using the FILEMODE variable.

I hope that the columns stay aligned.

<--Begin Quote-->
----------------------------------------------------------------------
Conference: (PASCAL_LESSONS-F)
Message:    4578
From:       LEONARD ERICKSON
To:         ART JOHNSTON
Subject:    RE: FILEMODE
Date:       07-23-97 17:13
----------------------------------------------------------------------

 -=> Quoting Art Johnston to All <=-

 AJ> I am writing a program that must use file sharing, timeslices,
 AJ> etc..
 AJ> The Programmer's reference, that came with Turbo Pascal defines 3
 AJ> "filemode"s, and makes the statement, "DOS version 3.x and higher
 AJ> defines additional modes, which are primarily concerned with
 AJ> file-sharing on networks... for more details see your DOS...".

 AJ> Well I grabbed the DOS manuals and no reference, does anyone have a
     unit or can assist me with the various filemodes.

 You need a copy of the Programmer's Reference Manual for DOS.

 But here's the unit I put together using the info in it. Just set
 filemode to the appropriate constants. (pay careful attention to the
 comments at the end)

 Example:
   filemode := ReadOnly + DenyNone;

 ---------------------------------
 unit fmode;
 interface
 const
   ReadOnly   : byte = $00;
   WriteOnly  : byte = $01;
   ReadWrite  : byte = $02;
   Compatible : byte = $00; {compatibility mode}
   DenyAll    : byte = $10; {prohibit both read and write access by
                                         others}
   DenyWrite  : byte = $20; {prohibit write access by others}
   DenyRead   : byte = $30; {prohibit read access by others}
   DenyNone   : byte = $40; {allow full access by others}
   NoInherit  : byte = $80; {file is private to current process and will
                             not be inherited by child processes}
 implementation
 end.

 {       AL = access and sharing modes
             bits 2-0: access mode
                 000 read only
                 001 write only
                 010 read/write
             bit 3: reserved (0)
             bits 6-4: sharing mode (DOS 3+)
                 000 compatibility mode
                 001 "DENYALL" prohibit both read and write access by
                                            others
                 010 "DENYWRITE" prohibit write access by others
                 011 "DENYREAD" prohibit read access by others
                 100 "DENYNONE" allow full access by others
             bit 7: inheritance
                 if set, file is private to current process and will not
                  be inherited by child processes

 File sharing behavior:
           |     Second and subsequent Opens
  First    |Compat  Deny   Deny   Deny   Deny
  Open     |        All    Write  Read   None
           |R W RW R W RW R W RW R W RW R W RW
  - - - - -| - - - - - - - - - - - - - - - - -
  Compat R |Y Y Y  N N N  1 N N  N N N  1 N N
         W |Y Y Y  N N N  N N N  N N N  N N N
         RW|Y Y Y  N N N  N N N  N N N  N N N
  - - - - -|
  Deny   R |C C C  N N N  N N N  N N N  N N N
  All    W |C C C  N N N  N N N  N N N  N N N
         RW|C C C  N N N  N N N  N N N  N N N
  - - - - -|
  Deny   R |2 C C  N N N  Y N N  N N N  Y N N
  Write  W |C C C  N N N  N N N  Y N N  Y N N
         RW|C C C  N N N  N N N  N N N  Y N N
  - - - - -|
  Deny   R |C C C  N N N  N Y N  N N N  N Y N
  Read   W |C C C  N N N  N N N  N Y N  N Y N
         RW|C C C  N N N  N N N  N N N  N Y N
  - - - - -|
  Deny   R |2 C C  N N N  Y Y Y  N N N  Y Y Y
  None   W |C C C  N N N  N N N  Y Y Y  Y Y Y
         RW|C C C  N N N  N N N  N N N  Y Y Y
 Legend: Y = open succeeds, N = open fails with error code 05h
         C = open fails, INT 24 generated
         1 = open succeeds if file read-only, else fails with error code
         2 = open succeeds if file read-only, else fails with INT 24
 }

 * Origin: Shadowshack (1:105/51)

<-- End of Quote-->

Re:Run-time error 150


JRS:  In article <34e19f7c.3888...@news.linkny.com> of Sun, 25 Jan 1998
20:30:42 in comp.lang.pascal.borland, Steve <NOT.H...@NOSPAM.com> wrote:

Quote
> unit fmode;
> interface
> const
>   ReadOnly   : byte = $00;
>   WriteOnly  : byte = $01;
>   ReadWrite  : byte = $02;
> ...

Those are preset variables.  ISTM better to omit ": byte ", so that they
become compile-time constants?

--
John Stockton, Surrey, UK.    j...@merlyn.demon.co.uk    Turnpike v1.12    MIME.
  Web <URL: http://www.merlyn.demon.co.uk/> - TP/BP/&c. FAQqish topics & links.
  Timo's TurboPascal <A HREF="ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip">FAQ</A>.
  <A HREF="http://www.merlyn.demon.co.uk/clpb-faq.txt">Mini-FAQ</A> of c.l.p.b.

Other Threads