you would need to use the FSCTL_GET_EXTENT_BUFFERS. The trouble is with this operation is that you don't know how large the buffer should be. I wrapped the call up in a class with the buffer as a static member. Each time the buffer is too small, I double the size and keep calling until successful.
The Extent count indicates how many fragments the file has, 0 indicates that it is located in the MFT. Each extent returned will then tell you how many clusters each fragment has. By adding these and multiplying by your drives 'bytes per cluster' you will find out exactly how much space a particular file/folder is taking.
Also be aware of NT's compressed runs which is indicated by a startLCN of -1. I still haven't managed to get my head around what this actualy means.
To be honest, I didn't touch that part of my code yet, I'm still working on my class hierarchy.
I was thinking to use ShellExec() with the "runas" flag, change the security settings and store them into a file, which I believe cacls is able to do. This should, in theory, allow the origional settings to be replaced once complete. But like I said, I didn't try this yet and probably won't for another week or so.
If you manage to do it using another method, I would be interested to see how.
i have establish a connection to remote computer by FTP and how to search file on remote computer in a particular directory and as soon as i found file i want to bring that file in my computer and search again for next file
plaese help me
thank u in advance
Hello to all,
right now i am doing a programm such that files selected by user will be uploaded on the server, now while uploading the files i want to invoke a progress bar dialog which will show the number of files uploaded and time left for uploading, through progress bar and this should be done without disturbing the process of uploading files. how it can be done? can anybody help me plz.
I would suggest the opposite: do the real work in a separate thread (in this case, the upload of the files) and regularly send messages with the current status to the progress dialog (which is in the main thread).
Yes, in your case, the progress dialog won't be a modal dialog (althought you call DoModal) because it is started in a separate thread. So, the user will still be able to interract with the main UI during the file upload, which is in general what you don't want.
Also, you still need to send messages (or find another way to communicate between the threads) because your dialog isn't aware of the current status of the upload. So, it doesn't make a difference.
I am facing the problem of memory leak. In one of the application I am taking dynamic global object. And when I try to delete then in my WinMain() function before return 0; statement but it gives me assertion errror.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture