Mkdir failure issues


#1

Having a problem creating directories. I can determine if they exist or not but not create them. The following is the code:


if(!file_exists($novelsDir))
{ print “StatusBanner.flashErr(“Base novel directory doesn’t exist”);”;
print “deBug.line(‘crtNvl’,“Base doesn’t exist”);”;
exit;
}
print “deBug.line(‘crtNvl’,”$novelsDir does exist");";

$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?


#2

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?


#3

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.


#4

In which folder is the EXE made with ExeOutput?


#5

Took a screen shot but I can’t see a way to post that. I’ve uploaded it to a server of mine - /publishing.secondgods.com/MOBI/Capture.GIF


My system files:

J:/Publishing/Webs - root containing index.html, index.exe and sub dirs Data, js, php and decor as well as the Web Creator.exop.

Both js and php have multiple levels to segregate functions.

Data contains subdirs callList, novels and templates.

novels will contain a dir for each novel title w/ various subdirs. You can see this by the expanded Deja Voos dir in the gif.

Both the novel subdirectory and its dependents are what I’m trying to create dynamically. (The ones you see in the gif were hand created.)


#6

Anything so far?


#7

Have you tried the latest release? ExeOutput 2018?


#8

Just installed 2018. Immediately got:


ExeOutput for PHP Compilation Log
Version 2018.0

Application Details

  • Title: Djinndom Inc. - Jacket Cover Construction
  • Author: Djinndom Press LLC
  • Date/Time: 2/26/2018 12:02:08 PM
  • PHP Runtime Version:

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\


#9

On checking the dir all I find is subdirs PHPRuntime7, PHPRuntime56 and PHPRuntime72. Changed it to 56 & compiled.

Will test today but I can tell you that the cross-monitor shearing is gone.


#10

ExeOutput for PHP 2018 doesn’t ship with PHP 5.4 anymore. So you have to change it to PHP V5.6.

Great!


#11

Tested and functions as expected. I can create multi-layered dirs now.

Is there a reason you can’t invoke a nested php file? “php/local/test.php” as opposed to “php/test.php” from JavaScript?

Same call, just switching php file names (and files) for test.

I can call the same “php/local/test.php” from within a “php/name.php” file.


#12

Could you please explain more? Or a sample code that shows what you are trying to do in JS?


#13

Sure.

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


#14

Strange. As if the file wasn’t compiled?


#15

I just went and redid everything and ran double tests. II must have done something wrong before. It works. Sorry for the distraction.


#16

OK. Great that it works now :wink: