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 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 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 } 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 ; 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
Archived
This topic is now archived and is closed to further replies.