$dr = “$novelsDir/$title”;
if(file_exists($dr))
{ print “StatusBanner.flashWarning(‘Novel directory for $title already exists.’);”;
print “deBug.line(‘crtNvl’,“novel dir $title already”);”;
exit;
}
print “deBug.line(‘crtNvl’,”$dr does not exist");";
#print “deBug.line(‘crtNvl’,“attempting mkdir on $dr”);”; #mkdir($dr);
$rl = realpath($dr);
print “deBug.line(‘crtNvl’,“attempting mkdir on $rl – aka: $dr”);”;
mkdir($rl);
exit;
The following are the results from several tests:
****** This is to demonstrate an existing directory.
crtNvl:: J://Publishing/Webs/Data/novels does exist
crtNvl:: novel dir Idol Hands already
****** These lines occur in all following tests…
crtNvl:: J://Publishing/Webs/Data/novels does exist
crtNvl:: J://Publishing/Webs/Data/novels/Money does not exist
****** Test to use the direct name…
crtNvl:: attempting mkdir on J://Publishing/Webs/Data/novels/Money
(This is the popup)
PHP Warning: mkdir(): No such file or directory in J:\Webs\php\local\novels\createNovel.php
****** Test with the realpath …
crtNvl:: attempting mkdir on J:PublishingWebsData ovelsMoney – aka: J://Publishing/Webs/Data/novels/Money
(This is the popup)
HP Warning: mkdir(): File exists in J:\Webs\php\local\novels\createNovel.php
Absolute path disabled or enabled with J:\Publishing\Webs\Data or X:\Data\ in the path fails in all cases.
Is there some setting I’m missing that allows me to create (sub)directories?
When you say that the directory exists, do you mean you created in the File Manager as a virtual folder, or in the “Data” subdirectory of the EXE file?
Could you also post the PHP code you’re using to make the different dirs?
Both my projects are attempts to move production from web to disk for existing, functioning applications. The web structure is “J://Publishing/Webs/db/novels/(names)” - J not really being the drive, (names) being variable. For disk I changed this to “J://Publishing/Webs/Data/novels/(names)” = J being the drive.
So… J://Publishing/Webs/Data/novels pre-exists and I want to create subdirectories for each book (names) via ExeOutput.
In the first graphics app, I successfully shelved my db inside Data. I did not have to create any sub-directories there but now I must.
So I still check for the novels sub (although I could jerk that code, it tests successfully). Then I check if the sub already exists. That I can do successfully by hand creating the novel name sub dir (Idol Hands) to check. That kicks an error (its non-existence falls through).
When the code falls through those two screens, I try to make the new sub. I cannot get that to succeed.
Code repeated:
#print “deBug.line(‘crtNvl’,“attempting mkdir on $dr”);”; #mkdir($dr);
$rl = realpath($dr);
print “deBug.line(‘crtNvl’,“attempting mkdir on $rl – aka: $dr”);”;
mkdir($rl);
exit;
I comment one set out to display one attempt, then the other out for the second. Neither work, nor any other permutation I’ve tried.
FATAL ERROR
The following error has occurred during compilation:
Invalid PHP runtime folder for PHP version : C:\Program Files (x86)\ExeOutput for PHP 2018\PHPRuntime54\
In the test program for nested subdirectories, I initially put the php file in the php directory in a subdir named ‘local’ (php/local). I made it required in the file manager and the exe compiled. However, when running, the program behaved as if it didn’t exist, simply doing nothing at all.
I then moved the exact same file to the root php directory, altered the file manager to reflect this, changed the JavaScript to access that and it ran correctly.
url sent to Ajax call in first instance: php/local/testing.php?novel=Truth Will Tell
url sent to Ajax call in second instance: php/testing.php?novel=Truth Will Tell