ghurty Posted January 25, 2010 Share Posted January 25, 2010 How would I right it to check to see if there is a current directory "$directory" is in a particular path /temp/ and if it isn't, create it with permissions that other php scripts can write to it? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/189695-how-would-i-right-it-to-check-to-see-if-there-is-a-current-directory-at-path/ Share on other sites More sharing options...
ghurty Posted January 25, 2010 Author Share Posted January 25, 2010 I found how to check if a file exists, but not a folder. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/189695-how-would-i-right-it-to-check-to-see-if-there-is-a-current-directory-at-path/#findComment-1001143 Share on other sites More sharing options...
oni-kun Posted January 25, 2010 Share Posted January 25, 2010 I found how to check if a file exists, but not a folder. Thanks Something like if (!is_dir('/temp/' . $directory)) { //If directory does not exixt mkdir('/temp/' . $directory , 0755); //Writable by owner } Quote Link to comment https://forums.phpfreaks.com/topic/189695-how-would-i-right-it-to-check-to-see-if-there-is-a-current-directory-at-path/#findComment-1001147 Share on other sites More sharing options...
ghurty Posted January 25, 2010 Author Share Posted January 25, 2010 Thank you, I tried that, but it does not proceded past that point. How do I tell it to continue processing the script after creating the directory if (!is_dir('/tmp/' . $directory)) { //If directory does not exixt mkdir('/tmp/' . $directory, 0750); //Writable by owner } $fromfile = "/tmp/" . $thisfile ; $tofile = "/tmp/'.$directory.'/" . $thisfile ; Quote Link to comment https://forums.phpfreaks.com/topic/189695-how-would-i-right-it-to-check-to-see-if-there-is-a-current-directory-at-path/#findComment-1001161 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.