i need to find empty directories for given list of directories
some directories have directories inside it
if inside directories also empty
i can say main directory is empty otherwise it's not empty
how can i test this
for example
A>A1(file1),A2 this is not empty beacuse of file1
B>B1(no file) this is empty
C>C1,C2 this is empty
...
I want to completely replace one directory on the file system with another directory in a temp directory. The tricky part is that the files in the folder to be replaced could be being used at any time, causing the replace operation to fail.
I need to somehow wait on an exclusive lock on the directory so that I can delete all of its cont...
The following works, but I figured - since it is all based on IEnumerable, Linq can come handy here is well. By the way, is there an equivalent to Directory.GetFiles() which would return an IEnumerable instead of the array? If it exists, then would it make the code run any faster? The last part of the question is inspired by Python langu...
Recently I ran into trouble when I discovered that vista restricts what can be installed into the system32 directory even though I am the administrator for this computer. It will not allow me to register dll files so I can use programs like wget globally like how programs "nslookup" etc are used. Keeps giving me this error.
Regsvr32...
i need to rewrite urls for my classified ads directory
i have 4 types of links
/City ==> display all ads in city
/City/Cat1 ==> display all ads in city + category
/City/Cat1/Cat2 ==> display add ads in city + category 1 + category 2
/City/Cat1/Cat2/Ad-id ==> display the ad itself and pass cat1 cat2 and city variables
original hidd...
browser.BrowseObject(PIDLFromPath, NativeMethods.SBSP_ABSOLUTE);
It works great in explorer, and for the common dialog. However, when running Office XP, it goes nuts. The view on the screen is refreshed, and shows the contents of the new folder correctly. However, the Combo Box up the top of the dialog still references the original ISh...
Hi,
I want to write a new file with the Java FileWriter. I use it like this:
FileWriter newJsp = new FileWriter("C:\\user\Desktop\dir1\dir2\filename.txt");
Now the dir1 and dir2 currently don't exist. I want Java to create them automatically if they aren't already there. Actually Java should set up the whole file path if not already ...
I am running Tomcat bundled with Liferay5.2.3 and use Eclipse 3.5 (Galileo) as my IDE. I set up my Tomcat server in Eclipse as per this blog entry: http://www.jroller.com/holy/entry/developing_portlets_for_liferay_in. If I start Tomcat via the Eclipse server config, Liferay/Tomcat uses my C:\Documents and Settings\user\Local Settings\T...
I have a bunch of files, either NSStrings or NSURLs (it doesn't matter; they are, for the most part, interchangeable), and I need a way to find the common ancestor directory. Does anyone know how to do this?
...
Hi !
If you add a directory in your Visual Studio project and you add a class inside it, the namespace will respect the whole path the directory inclusive.
But sometimes, I prefer having the class in the main project namespace, although it lies in a directory structure, just because I don't want to have mess in my code.
So often happe...
Created using Sphinx 0.6.5.
I know Python's documentation uses reStructuredText, but it has different sections like http://docs.python.org/whatsnew/2.6.html and http://docs.python.org/tutorial/index.html.
How do you do this in reStructuredText? Do you run rst2html in a bunch of directories, keeping its structure?
I know that it us...
Just had something really weird happen, and I'm not sure why. Our site crashed because PHP couldn't write a cache file to a directory which is created automatically by the script. When I investigated, I saw that the directory had NO permissions: no read or write for owner, group, or public.
This script creates directories hundreds of t...
I am using the following code in WINDOWS OS and PHP script, in which initially i am taking the difference of two folder structure and then the out put needs to be copied to other folder. here is the code below..
$source = '/var/www/html/copy1';
$mirror = '/var/www/html/copy2';
function scan_dir_recursive($dir, $rel = null) {
$all_pat...
Hi all.
I hope everybody is doing fine.
I try to delete a virtual directory using WMi (Server Manager Class) and recreate with different values.
The problem i am facing is that the virtual directory is not getting deleted. Please help.
How to check existance of a virtuual dir and the call delete?
and similarly how check whether a ...
I have a mysql database of users that can login to my site and view content. I would like to block a couple of directories from certain users. What is the best way to do this.
Currently when a user logs in a cookie is created with their customer id and the customer is is used to display their content.
How would I block entire directori...
I have an ASP.Net MVC app, and i have some xsl files inside of the Content directory.
I've try a few methods to get directory dynamically buy keep on coming short.
So how do i get the directory to point to the Content/xsl folder?
the closest that i came to was with this:
this.GetType().Assembly.CodeBase
which only returns the proje...
In the same vein as http://stackoverflow.com/questions/2593399/process-a-set-of-files-from-a-source-directory-to-a-destination-directory-in-pyth I'm wondering if it is possible to create a function that when given a web directory it will list out the files in said directory. Something like...
files[]
for file in urllib.listdir(dir):
...
Hi,
I'm working on an internal web app and I need to get a directory path from the user. I (obviously) can use the asp:FileUpload to get a file but I can't find anything to just get a directory path.
Is there any (preferably simple) way to have a directory-chooser dialog in asp.net? I haven't been able to find any solution on Google or...
For some reason, I keep getting a '1' for the file names with this code:
if (is_dir($log_directory))
{
if ($handle = opendir($log_directory))
{
while($file = readdir($handle) !== FALSE)
{
$results_array[] = $file;
}
closedir($handle);
}
}
When I echo each element in $results_arra...
I want to make a home directory for each user of every group in AD using a batch script.
the users personal directories (my documents, ...) should be stored in there as well.
the path should be as following:
\Fileserver{group name}{user name}
can someone give me some pointers on how to achieve this?
...