MoveFile() API reporting failure

Tags:
C
Desktops
Development
Servers
Windows
Windows 2000 desktop
Windows 2000 Server
Windows Server 2003
Windows tools/WSRM
We have a problem with the MoveFile() API called from C++ reporting failure, but actually working! We have a C++ Application which reads Data from a file, moves it to another Folder using the MoveFile() API and then updates the Time Stamp using the _utime() API. This works fine on my Laptop (W2K Pro) and worked fine on a Customer's Server (NT 4.0). But now that the Server has been upgraded to W2K Server, the MoveFile() API returns a failure. The Server is a HP/Compaq Proliant ML350 (2.2GHZ Zeon) with a SCSI Disk Drive. I have captured the File activity using FileMon from SysInternals - see next post - why are they so different??? Does anyone have any ideas on what is going wrong and how to fix it? Is there some timing issue with W2K Server on the particular PC? Thanks

Answer Wiki

Thanks. We'll let you know when a new response is added.

FileMon captures where “old” is original path and filename and “new” is new path and filename:

Laptop (ok):
OPEN old SUCCESS Options: Open Access: All
QUERY INFORMATION old SUCCESS FileObjectIdInformation
OPEN new SUCCESS Options: Open Access: All
OPEN new FILE NOT FOUND Options: Open Access: All
SET INFORMATION old SUCCESS FileRenameInformation
OPEN old SUCCESS Options: Open Access: All
QUERY INFORMATION old SUCCESS FileBasicInformation
CLOSE old SUCCESS
OPEN old SUCCESS Options: Open Access: All
QUERY INFORMATION old SUCCESS Attributes: CA
SET INFORMATION old SUCCESS FileBasicInformation
QUERY INFORMATION old BUFFER OVERFLOW FileFsVolumeInformation
QUERY INFORMATION old SUCCESS FileInternalInformation
CLOSE old SUCCESS
OPEN old SUCCESS Options: Open Access: All
QUERY INFORMATION old SUCCESS FileBasicInformation
CLOSE old SUCCESS
CLOSE new SUCCESS
CLOSE new SUCCESS
OPEN new SUCCESS Options: Open Access: All
OPEN new SUCCESS Options: Open Access: All
QUERY INFORMATION new SUCCESS Attributes: CA
SET INFORMATION new SUCCESS FileBasicInformation
QUERY INFORMATION new BUFFER OVERFLOW FileFsVolumeInformation
QUERY INFORMATION new SUCCESS FileInternalInformation
QUERY INFORMATION new SUCCESS Length: 788
CLOSE new SUCCESS
OPEN new SUCCESS Options: Open Access: All
QUERY INFORMATION new SUCCESS FileBasicInformation
CLOSE new SUCCESS
SET INFORMATION new SUCCESS FileBasicInformation
CLOSE new SUCCESS

Server (reporting fail):
OPEN old SUCCESS Options: Open Access: All
QUERY INFORMATION old SUCCESS FileObjectIdInformation
OPEN new SUCCESS Options: Open Access: All
SET INFORMATION old SUCCESS FileRenameInformation
CLOSE new SUCCESS
OPEN new SUCCESS Options: Open Access: All
SET INFORMATION new SUCCESS FileBasicInformation
CLOSE new SUCCESS
OPEN old FILE NOT FOUND Options: Open Access: All

Why are these so different? – it is as if there are 2 instances in the working version interleaving!

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • HenryKafeman
    Is there nobody out there who can help?
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following