Hi everyone i m facing one problem while writing buffer into a file.
Actually i m using Ramanan T's NTFS undelete code for reading MFT table for files in
NTFS file system of a partition. Undelete a file in NTFS
I m getting junk characters for small headers files of visual studio.Its reading all other formatted files like .doc,.xls or JPEG,.bmp etc properly.Even large sized cpp files also reading properly.i m reading 4kb ie one cluster at a time.
Here is the code where i m getting the junk characters.
public: Í ErrorLog(void);
I m not able to find out why that junk is coming in between for some files only
I have not looked at the source code at the link you provided. However I know from experience that small files under 1kb are not stored on a disk cluster on an NTFS disk. On a disk with a 4kb cluster size it would waste 3+ kilobytes. They are instead stored directly in the $MFT FRS segment. Check the source code and see if the author added special code for this sitation.
You should not trust that all source code you find on the internet is written correctly to handle all sitations.
ya David ur absolutely right that i should not depend completely on the code,but as you had asked that is there is any special provision made in this code to handle Resident files which are stored in $MFT FRS.Yes there is but still same problem is coming.Out of 100 only 2 or 3 files are being getting corrupted.Actually i dont know how to read MFT table through data runs (by using VCN's & LCN's) thats why i m using that code .If u have any idea about reading MFT table please let me know ...........
My MFC application needs to monitor a directory on a network disk (mapped as Z , and I'm using FindFirstChangeNotification() to do this. However, I am getting an INVALID_HANDLE_VALUE returned, and GetLastError() return 56 (which appears to be "The network BIOS command limit has been reached."
If I change the path of the monitored folder to a local drive, it works fine. How do I get over this problem ? (MSVC 6.0 - Win2000) (All the results from a Google search only seem to refer to a server situation)
But the loop gets suspended at WaitOnMultipleObjects() after the very FIRST invocation of FindFirstChangeNotification(). (The whole reason for using this approach is to get away from a polling mechanism which introduces a delay) As I said originally, the code works fine when the target is a local disk - something to do with network, and I don't know how to fix it !!)
Hi Killabyte, Actually, I'm getting the problem single-stepping in the debugger, so the loop isn't executing as such. Also the WaitOnMultipleObjects() has an INFINITE timeout. I don't quite know how FindFirstChangeNotification() is implemented, but presumably the problem resides in the firmware of the network disk controller - have logged on to it, but can't see any parameters in the SMB server that I can tweak. Or am I missing something here ?