In PHP, what would be the cleanest way to get the parent directory of the current running script relative to the www root? Assume I have:
$_SERVER['SCRIPT_NAME'] == '/relative/path/to/script/index.php'
Or just:
$something_else == '/relative/path/to/script/'
And I need to get /relative/path/to/ with slashes properly inserted. What w...
The structure for the current project I am working on is something like:
root/index.php
root/includes/php/first.php
root/includes/php/functions.php
So index.php includes first.php:
<?php include_once("includes/php/first.php"); ?>
Normally then my first.php would call functions like:
<?php include_once("includes/php/functions.php"...
shutil.rmtree will not delete read-only files on Windows. Is there a python equivalent of "rm -rf" ? Why oh why is this such a pain?
...
Hello:
I had a question about where a MySql database has to sit for a Tcl application to read it. Currently, I have a Tcl application that reads off of a sqlite database. For the application to find the database, the Sqlite Db must be located in the same folder as the Tcl application. I am planning on upgrading the Sqlite Database t...
Hello, I am creating a script to create new folder hierarchies for a friend of mine. There are around a thousand clients, so a script would save a ton of time. I have everything almost working, the part I don't have is this.
yearList = os.listdir(driveLetter + clientName)
for year in yearList:
os.chdir(year)
os.mkdir('Folder O...
Hi,
I want to do some interaction testing in my test project, and would like to test some xml configuration based components... How can I find the base directory of the test project in code so that I can create paths relative to it? I want to have a sub folder that contains the test xml files.
Thanks
EDIT:
Iv used Assembly.GetExecuti...
How do I get a list of the folders that exist in a certain directory with ruby?
Dir.entries() looks close but I don't know how to limit to folders only.
...
I have designed a website, and within it I have a range of PHP scripts which interact with my system. For example, if a user uploads an image, this is processed by the script
image.php
and if a user logs in this is processed by the script
login.php
All these scripts are stored in the folder called: scripts
how do I ensure someone...
Are there any guidelines or standards out there for folder names starting with a period? (e.g.: .NET). I have an installer that requires this to happen and right now we are using 'DotNET' instead of '.NET' for our folder names.
Thanks!
...
Is it possible to set a default folder to access instead of a file like "index.html".
What I'd like to to is make it so that when a person visits my site they get redirected to a folder within the root of the domain. I am using a blogging engine and I need it to show up as the homepage but I don't want to install it in the root because...
Hi,
I have two signed Jars, a.jar and b.jar.
a.jar is launched as an applet inside the browser and b.jar is in Appdata/locallow/xyz (Vista). a adds b to it's classpath and calls some functions of b.jar. So far so good. Now b unpacks some dlls into the working directory and depends on them. It must be the working directory, because the d...
Filezilla is taking forever to delete a nested directory structure from my website. Why does it have to change into each sub directory and delete files instead of just removing the whole top most directory in one go? Is removing a file the only supported command in the FTP RFC and does recursive directory removal have to be implemented...
Hi there,
Is it possible in c++ to count the number of files with a given extension in a directory?
I'm writing a program where it would be nice to do something like this (pseudo-code):
if (file_extension == ".foo")
num_files++;
for (int i = 0; i < num_files; i++)
// do something
Obviously, this program is much more complex,...
As the title suggests, I'm looking for a way to get attributes of a large number of files in a directory, but without adding the cost of an additional disk access for each file.
For example, if I get the Name attribute of FileInfo objects in a collection, then there is no additional disk access. However if I get the LastWriteTimeUtc, th...
Let's say I have one directory in my filesystem, which has a number of subdirectories and files. The number of subdirectories and files in this directory runs to many tens of thousands. You'll be familiar with the significant delay you'll get in attempting to view the contents of this directory, even in a terminal.
I've seen this solu...
When I create a category in my CMS, I want to create its directory/folder in an image directory.
Can I create a directory or folder with php?
Can anyone tell me how please?
...
I'm looking for a script to generate the graphical-ish textual representations of directory structures that you see around. Something that I can run like this:
james@computer:/.../basedir$ listdir .
basedir
|-firstsubdir
| |-file
| `-subsubdir
| |-file1
| |-file2
| |-file3
| `-file4
`-secondsubdir
james@computer:/.../basedir$
...
I know that / is illegal in Linux, and the following are illegal in Windows (I think): * . " / \ [ ] : ; | = ,
What else am I missing?
I need a comprehensive guide, however, and one that takes into account double-byte characters. Linking to outside resources is fine with me.
I need to first create a directory on the filesystem usin...
Well I want to use WEb2Py because it's pretty nice..
I just need to change the working directory to the directory where all my modules/libraries/apps are so i can use them. I want to be able to import my real program when I use the web2py interface/applications. I need to do this instead of putting all my apps and stuff inside the Web2P...
I want to check if there is a directory exist or not before uploading a file.
If the directory does not exist return FALSE.
Does is_dir do the work?
...