solarisuser Posted August 14, 2008 Share Posted August 14, 2008 Hi All, I'm trying to figure out if a while loop is what I really need to use. My goal is to copy a dynamic amount of data from C:\ to D:\. I have a routine to detect the used hard disk space on C:\ and the free disk space on D:\. If D:\ does not have enough space for the copy, I delete a folder, then I want to run the code again to detect the used hard disk space on C:\ and the free disk space on D:\. If I still need more space, I delete another folder, and run the code again, etc. Right now I run the code to detect the hard disk size, and if I need to delete a folder, I have: while($size_to_copy > $size_free) { // delete folder // run code to update $size_to_copy and $size_free } However, running code inside the while loop to generate an updated $size_to_copy and $size_free do not seem to tell the while loop of the new values. Any direction on my next steps would be great - thanks! Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted August 14, 2008 Share Posted August 14, 2008 Changes inside the loop are checked again when the loop starts over. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.