I have written an application that:
1) writes a modified JPEG file to the application folder.
<then I wait for the next null event>
2) copies the modified JPEG file over an ethernet network
from the application folder to a folder on another
Macintosh running a Spider Island BBS.
<then I wait for the next null event>
3) copies the modified JPEG file over an ethernet network
from the application folder to a folder on an NT File Server.
The NT server is being used only for file storage.
<then I wait for the next null event>
4) Then I kill the original JPEG file in my application folder.
The file copied to the other Mac is written fine. The file written
to the NT server is OK in the resource fork but about 25% to 33%
of the tailend of the datfork is missing.
Bad NT files happen randomly, most of the NT files are written correctly.
The bad files always occur at roughly the same time, early evening
when the application machine is under the heaviest load, running
my application and Eudora pro and at the same time.
The original JPEG files arrive as Email attachments, my app modifies
both forks of the received files.
The copy routine is below adapted from the FB handbook examples.
CLEAR LOCAL
LOCAL FN myCopyResDataFile%(copyName$, srcWDnum%, targWDnum%)
DIM pbBlk.80
DIM fndrData.16
DIM copyPtr&
DIM srcPath$, TargPath$
DIM pbPtr&, osErr, dataSize&, rsrcSize&
DIM saveName$
pbPtr& = @pbBlk
LONG IF copyName$ <> ""
saveName$ = copyName$
LONG IF saveName$ <> ""
srcPath$ = FN convertWDRef$(copyName$,srcWDnum%)
TargPath$ = FN convertWDRef$(copyName$,targWDnum%)
' *** get file's finder information for later
pbPtr&.ioCompletion& = 0
pbPtr&.ioNamePtr& = @copyName$
pbPtr&.ioVRefNum% = srcWDnum%
pbPtr&.ioFDirIndex% = 0
osErr = FN GETFILEINFO (pbPtr&)
BLOCKMOVE pbPtr& + _ioBuffer, @fndrData, 16
' *** copy data fork side of file
OPEN "ID", #4, srcPath$, 1, 0
dataSize& = LOF (4, 1)
LONG IF dataSize& <> 0
copyPtr& = FN NEWPTR (dataSize&)
LONG IF copyPtr& <> 0
READ FILE #4, copyPtr&, dataSize&
OPEN "OD", #7, TargPath$, , 0
WRITE FILE #7, copyPtr&, dataSize&
osErr = FN DISPOSPTR (copyPtr&)
END IF
END IF
CLOSE
' *** copy rsrc fork side of file
OPEN "IR", #5, srcPath$, 1, 0
rsrcSize& = LOF (5, 1)
LONG IF rsrcSize& <> 0
copyPtr& = FN NEWPTR (rsrcSize&)
LONG IF copyPtr& <> 0
READ FILE #5, copyPtr&, rsrcSize&
OPEN "OR", #8, TargPath$, 1, 0
WRITE FILE #8, copyPtr&, rsrcSize&
osErr = FN DISPOSPTR (copyPtr&)
END IF
END IF
CLOSE
' *** set saved file's finder information
pbPtr&.ioCompletion& = 0
pbPtr&.ioNamePtr& = @saveName$
pbPtr&.ioVRefNum% = targWDnum%
pbPtr&.ioFDirIndex% = 0
osErr = FN GETFILEINFO (pbPtr&)
BLOCKMOVE @fndrData, pbPtr& + _ioBuffer, 16
osErr = FN SETFILEINFO (pbPtr&)
END IF
END IF
END FN = SYSERROR
Anybody got any ideas?
Cheers,
--------------------------------------------------------------
Michael Evans
Manager of Software Development
Photo Systems, Inc.
3301 Wood Valley Road, NW
Atlanta, GA 30327-1515
Office: (404) 846-9386
Fax: (404) 240-0878
Home: (404) 240-0330
E-mail: evans@..., (mikonic@...)
--------------------------------------------------------------