Link to home
Start Free TrialLog in
Avatar of lowlevel
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?
Avatar of alexo
alexo
Flag of Antarctica image

And the value of nmFile is...
Avatar of nietod
nietod

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
Avatar of hasmet
hasmet

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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);