lowlevel
asked on
createfile problems
hFile:=createFile (
nmFile, GENERIC_READ,
FILE_SHARE_READ, nil, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, FILE_FLAG_NO_BUFFERING
);
if hFile=INVALID_HANDLE_VALUE then
raise eFileCopy.createLastError (
'could not open source file '+sp+' to get it''s size.');
this results in an system error 50 ("the network request is not supported") for me on a windows 95 system, and no errors on NT (same filename). What am I doing wrong here?
nmFile, GENERIC_READ,
FILE_SHARE_READ, nil, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, FILE_FLAG_NO_BUFFERING
);
if hFile=INVALID_HANDLE_VALUE
raise eFileCopy.createLastError (
'could not open source file '+sp+' to get it''s size.');
this results in an system error 50 ("the network request is not supported") for me on a windows 95 system, and no errors on NT (same filename). What am I doing wrong here?
And the value of nmFile is...
Also have you tried it without NO_BUFFERING. I know you want to avoid the overhead of buffering when you are just geting the file size, but there are a lot of restrictions associated with it and it could be causing a problem. Its worht a try.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oh I see the problem. Hasmet is on the right track. You have a comma where you want a "|" and you are missing the last parameter.
Try
createFile (nmFile, GENERIC_READ,
FILE_SHARE_READ, nil, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_NO_BUFFERING,
NULL);
Try
createFile (nmFile, GENERIC_READ,
FILE_SHARE_READ, nil, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_NO_BUFFERING,
NULL);