allocating disk space
-
My application needs allocate disk space to some of it's directories. For example: directory "Client1" with 2 mb and directory "Client2" with 3 mb My application should be able to write data of (2+3) 5 mb to those directories. But with or *without* writing any data, The Windows should feel those directories have taken that much space. Or when other applications check the free disk space, Windows must show 5 mb less in the actual space. IS any functions are there to partiton the hard disk and also to lock the folder Please help me -- modified at 7:00 Friday 3rd February, 2006
-
My application needs allocate disk space to some of it's directories. For example: directory "Client1" with 2 mb and directory "Client2" with 3 mb My application should be able to write data of (2+3) 5 mb to those directories. But with or *without* writing any data, The Windows should feel those directories have taken that much space. Or when other applications check the free disk space, Windows must show 5 mb less in the actual space. IS any functions are there to partiton the hard disk and also to lock the folder Please help me -- modified at 7:00 Friday 3rd February, 2006
Well just fill a file with zeros ::- ). -= E C H Y S T T A S =- The Greater Mind Balance
-
My application needs allocate disk space to some of it's directories. For example: directory "Client1" with 2 mb and directory "Client2" with 3 mb My application should be able to write data of (2+3) 5 mb to those directories. But with or *without* writing any data, The Windows should feel those directories have taken that much space. Or when other applications check the free disk space, Windows must show 5 mb less in the actual space. IS any functions are there to partiton the hard disk and also to lock the folder Please help me -- modified at 7:00 Friday 3rd February, 2006
I do not know if that is possible, directly. Here is a way that you may be able to do it: 1) create a file that takes up the required space. This file contains no valid data, it is just a place holder. The idea here is just to insure that you have at least that much disk space to work with. 2) When you need to add another file to the directory, calculate how many bytes of data it will require. Then reduce the size of the place holder by that many bytes, before you save the new file. I recommend that durring testing, that you verify that the number of bytes you calculated matches the actual number of bytes required. That should do the trick, but there are many other things you should consider provided that the number of bytes required might excceed what you think they will. INTP Every thing is relative...
-
I do not know if that is possible, directly. Here is a way that you may be able to do it: 1) create a file that takes up the required space. This file contains no valid data, it is just a place holder. The idea here is just to insure that you have at least that much disk space to work with. 2) When you need to add another file to the directory, calculate how many bytes of data it will require. Then reduce the size of the place holder by that many bytes, before you save the new file. I recommend that durring testing, that you verify that the number of bytes you calculated matches the actual number of bytes required. That should do the trick, but there are many other things you should consider provided that the number of bytes required might excceed what you think they will. INTP Every thing is relative...
ok sir Is there any function specific how to partition the hard disk to allocate some space for my application,also how to lock (or) hide folder in vc
-
ok sir Is there any function specific how to partition the hard disk to allocate some space for my application,also how to lock (or) hide folder in vc
First, do not throw around the word partition so casualy. A partial answer would be yes, but only why your program is running. I am not talking about partitioning the hard-drive (do not even think of doing that), I am talking about reserving space on the disk. How you would do it I can not say, because I would need to do research just like you. I have a book around here some where that would probably tell me exactly how to do it. But the method I originaly sugested should work on any system, it does not require that your program be running in order for the space to be reserved. INTP Every thing is relative...
-
My application needs allocate disk space to some of it's directories. For example: directory "Client1" with 2 mb and directory "Client2" with 3 mb My application should be able to write data of (2+3) 5 mb to those directories. But with or *without* writing any data, The Windows should feel those directories have taken that much space. Or when other applications check the free disk space, Windows must show 5 mb less in the actual space. IS any functions are there to partiton the hard disk and also to lock the folder Please help me -- modified at 7:00 Friday 3rd February, 2006
It *almost* sounds like you need to use sparse files. Another solution would be to use
SetFilePointer()
/SetEndOfFile()
pair.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
-
First, do not throw around the word partition so casualy. A partial answer would be yes, but only why your program is running. I am not talking about partitioning the hard-drive (do not even think of doing that), I am talking about reserving space on the disk. How you would do it I can not say, because I would need to do research just like you. I have a book around here some where that would probably tell me exactly how to do it. But the method I originaly sugested should work on any system, it does not require that your program be running in order for the space to be reserved. INTP Every thing is relative...
ok sir Tell the some useful books which i could refer for memory management and i have one thing how to restrict the folder so that other user shoud not access my folder
-
First, do not throw around the word partition so casualy. A partial answer would be yes, but only why your program is running. I am not talking about partitioning the hard-drive (do not even think of doing that), I am talking about reserving space on the disk. How you would do it I can not say, because I would need to do research just like you. I have a book around here some where that would probably tell me exactly how to do it. But the method I originaly sugested should work on any system, it does not require that your program be running in order for the space to be reserved. INTP Every thing is relative...
How to allocate space dynamically to my application.Is there any functions to use and how can it be usefull explain me ok.