Hi All:
Here's my little proggie below
#INCLUDE "C:\MGW\SOURCE\
INCLUDE2.CH"
FUNCTION Main()
local i,j
local cJdrv,nJdrvtype,nKdrvtype
local lGotJ,lGotK
local cSrc,cDST,nBytes
local nOSERR,nHBERR
cJdrv := "J:"
cKdrv := "K:"
cSrc := "c:\download\somecrap.txt"
cDst := "c:\download\loadofcrap.txt"
cNetDst := "j:\download\loadofcrap.txt"
cls
// now test if J:drive exists
lGotJ := isdisk(left(cJdrv,1))
if .not. lGotJ
alert("No SUCH Drive J. Start network and try again.")
quit
endif
?
? "Drive J exists"
?
// Now test if its a network drive
nJdrvtype := drivetype(left(cJdrv,1))
if nJdrvtype <> 5
alert(" Drive J: is NOT a network Drive")
quit
endif
? "Drive Type of J: is "+ntoc(nJdrvtype)
?
// Try to pass a file from C: to C: first
nBytes := filecopy(cSrc,cDst)
alert("Number of bytes passed is: " + ntoc(nBytes))
// Response above was 2678 bypres passed
// Now Try to pass a file from C: to J: now
nBytes := filecopy(cSrc,cNetDst)
// Respinse above was 0 bytes passed
nOSErr := HB_OSERROR()
nHBERR := FERROR()
if nbytes == 0
alert("Operation Failed. No Bytes Copied. Err1 Code = "+ NTOC(nOSERR)+" Err2 Code = "+NTOC(nHBERR))
// response above was 0 bytes passed, and both error codes showed 0 as the code !
quit
endif
alert("Number of bytes passed is: " + ntoc(nBytes))
alert("Quit Now")
return nil