Technical article 101713

Application using DosCopy() function call returns an error code 2

OpenServer 5.0.0

Written · Last revised

Problem

The DosCopy() function call that copies a file or subdirectory returns an error code 2 when the compiled program is run.

Cause

This error may be generated when a treecopy is requested and
the source has not been specified to be a directory.  The
SMB 2.0 specification states that in order to use the DosCopy()
function call for a treecopy, the source has to be a directory.

Solution

The behavior of applications when using the Doscopy() function call to copy files to SCO Lan Manager servers differs:

- With Lan Manager 1.x,  there are no checks in place at the
SMB level so using DosCopy() with treecopy will be successful.
- With Lan Manager 2.x,  we conform to the SMB 2.0 specification
and will fail the treecopy if the source is not a directory.
SCO is aware that some developers require the DosCopy() function
call to succeed even if the source is not a directory.  This is
under investigation.

The DosCopy() function call is defined in the Microsoft OS/2 Programmer's Reference.

From the Xinuos technical article database, record 101713. Reproduced with permission. The original is at www.sco.com/ta/101713, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.