A JavaScript instruction:
. . .embedded in a html file will assign a value to path, for example:
What I need ( . . .not the server root) is the absolute path from the system root, e.g.:
Perl can do this:
. . .and return the assigned value for $path as:
Note that the returned value of $path is the directory of cgi-bin where the Perl script resides . . .not what I need!
I have an application that needs to create subdirectories of a current working directory. Also, a subdirectory could become a parent of a future subdirectory . . .and so on. Each subdirectory will contain a README.html file that is auto-executed by the Apache http server's display of the directory's index list. This html file contains some file manipulation functions, including one to create a new subdirectory.
I need to capture the path of the current directory containing an individual README.html file, and pass the path as a parameter to a Perl script in cgi-bin. This Perl script will prompt the user for a user id., directory name, file permissions, etc. Then the name for the new subdirectory specified by the user can be concatenated to the $path string, and the new subdirectory can be created in the named subdirectory, e.g."
This seems like a simple thing to do . . .certainly within OS/400, Unix shell, etc., but I cannot find an example of a simple line of JavaScript code to produce the absolute path string as per Perl.
(I'm sure that I can write a half-page of code replete with regex'es, sed's, chomps, cat's, ad nauseam, but isn't there a simple way to do this?)
Suggestions will be greatly appreciated,
Ron W.
Code:
var path = document.location.pathname;
. . .embedded in a html file will assign a value to path, for example:
Code:
/htdocs/Photolib/ThisWeek/
What I need ( . . .not the server root) is the absolute path from the system root, e.g.:
Code:
/usr/local/www/vhosts/archaxis.net/htdocs/Photolib/ThisWeek/
Perl can do this:
Code:
use Cwd;
my $path = getcwd;
. . .and return the assigned value for $path as:
Code:
/usr/local/www/vhosts/archaxis.net/cgi-bin/perl
Note that the returned value of $path is the directory of cgi-bin where the Perl script resides . . .not what I need!
I have an application that needs to create subdirectories of a current working directory. Also, a subdirectory could become a parent of a future subdirectory . . .and so on. Each subdirectory will contain a README.html file that is auto-executed by the Apache http server's display of the directory's index list. This html file contains some file manipulation functions, including one to create a new subdirectory.
I need to capture the path of the current directory containing an individual README.html file, and pass the path as a parameter to a Perl script in cgi-bin. This Perl script will prompt the user for a user id., directory name, file permissions, etc. Then the name for the new subdirectory specified by the user can be concatenated to the $path string, and the new subdirectory can be created in the named subdirectory, e.g."
Code:
/usr/local/www/vhosts/archaxis.net/htdocs/Photolib/ThisWeek/[B]Tuesday[/B]
This seems like a simple thing to do . . .certainly within OS/400, Unix shell, etc., but I cannot find an example of a simple line of JavaScript code to produce the absolute path string as per Perl.
(I'm sure that I can write a half-page of code replete with regex'es, sed's, chomps, cat's, ad nauseam, but isn't there a simple way to do this?)
Suggestions will be greatly appreciated,

Ron W.