directory

How can my Perl script find its module in the same directory?

I recently wrote a new Perl script to kill processes based on either process name / user name and extended it using Classes so that I could reuse the process code in other programs. My current layout is - /home/mutew/src/prod/pskill <-- Perl script /home/mutew/src/prod/Process.pm <-- Package to handle process descriptions I ad...

Is there a way to get all the directories but not files in a directory in Python?

This link is using a custom method, but I just wanna see if there is a single method to do it in Python 2.6? ...

Best way to require all files from a directory in ruby ?

What's the best way to require all files from a directory in ruby ? ...

PHP mkdir(), chmod() and Windows

Hello, I am using the PHP function mkdir($path, 0777) to create a new directory on an Apache server (running on Windows). When I create this and view the folders, Windows has set the dir as read only. Is there a way of changing this without using exec() to cacls.exe? The PHP documentation states that chmod() doesn't work on Windows bu...

directories in a zip file when using java.util.zip.ZipOutputStream

Lets say I have a file t.txt, a directory t and another file t/t2.txt. If I use the linux zip utility "zip -r t.zip t.txt t", I get a zip file with the following entries in them (unzip -l t.zip): Archive: t.zip Length Date Time Name -------- ---- ---- ---- 9 04-11-09 09:11 t.txt 0 04-11-...

Ruby Deleting subdirectories that contain only a specific directory

I need to delete a bunch of subdirectories that only contain other directories, and ".svn" directories. If you look at it like a tree, the "leaves" contain only ".svn" directories, so it should be possible to delete the leaves, then step back up a level, delete the new leaves, etc. I think this code should do it, but I'm stuck on what ...

Search Outlook directory

Hi, I'd like to know if it possible to search for people in Outlook directory via the Outlook COM component. If so, how? I've referenced the COM component and created a Microsoft.Office.Interop.Outlook.Application object in my C# code, but I don't know how to go further. What I wnat to do is have a first and last name as input, and be ...

Where to put global application data in Vista?

Where in a Windows (Vista) system should I place data that ought to be readable and writable by everyone, i.e. every user of the computer? Vista's concepts of C:\Users\xxx\AppData\something, C:\Program Files and C:\ProgramData directories and UAC are a bit confusing. Furthermore, is there any ready solution to determine those locations ...

Batch File To Display Directory Size

Hi guys just wondering if u can help me modify this script that ive been playing around with, i cant get it to accept wildcard charcters '*' @echo off setLocal EnableDelayedExpansion set /a value=0 set /a sum=0 FOR /R %1 %%I IN (*) DO ( set /a value=%%~zI/1024 set /a sum=!sum!+!value! ) @echo Size is: !sum! k Its in a batch file calle...

How can I monitor a Windows directory for changes?

When a change is made within a directory on a Windows system, I need a program to be notified immediately of the change. Is there some way of executing a program when a change occurs? I'm not a C/C++/.NET programmer, so if I could set up something so that the change could trigger a batch file then that would be ideal. ...

Linux Command: Directory inside a directory

So I have have a directory - lets say /dir/. In it I have these folders- /dir/fold1/ /dir/fold2/ /dir/fold3/ each of these folders (fold1,2,3) may contain a folder called foo. I want to list all the folders inside dir, that have inside them a folder called foo. Thanks! ...

How to replace a directory with the same name with new one?

I am putting a check that if a directory by a name exists then it should delete that directory and replace it with the new one. For that i am having this code: if (Directory.Exists(b)) { Directory.Delete(b); Directory.CreateDirectory(b); } where b is the name of the directory for which i am outting the check. I am getting a ru...

Is there a standard directory browser dialogue that I can call in MFC that doesn't involve the user having to create directories to specify ones that don't yet exist?

I am working on the bootstrap application of an installer, and I have a dialogue that the user can open to select a different target directory from the given default. Currently, I'm using the CFolderDialog for that, but for the user to select a folder that doesn't yet exist, he has to create the folder first. Once the user has specified ...

Unable to move all files except directories to a folder in terminal

I have extended regexes enabled in my Bash by shopt -s extglob They may be useful in solving the problem. I run the following unsuccessfully, since it moves also directories $ mv `find . -maxdepth 1` django-tes/ I am trying to find all files except directories and move them to a directory called django-tes/. How can you move all ...

Understanding Linux directory permissions reasoning

Hi I have 2 questions regarding linux directory permissions which I do not understand. I removed the execute flag from a folder named Documents. After that I cannot use cd on it but I still can do "ls Documents" from the parent directory and it still lists me the files in the Documents directory. I though the missing x-flag denies read...

Directory.GetFiles works, Directory.GetDirectories doesn't on the same directory

I have a simple file selector on my web application which uses Directory.GetFiles and Directory.GetDirectories to produce the UI. This works perfectly on my localhost, but when I upload it to my Windows Server 2003 hosting I can only see files - on the same directory, GetFiles works but GetDirectories doesn't. The code is incredibly si...

Using System.IO.Delete to remove certain files from a directory?

I have 2 images inside a folder called Pics..... Image1.jpg and Image2.jpg. What code must i place inside my Submit button to just delete Image1.jpg located here "~/Pics/Image1.jpg" Any help would be great!!! ...

How to recursively chmod on subdirectories?

I want to recursively chmod all of the subdirectories below my calcium directory: chmod a+wx calcium How do I change the above command to do this? I believe I'm using bash shell although I'm not sure how to verify this. ...

Directory dependencies with rake

I'm using rake to copy a directory as so: file copied_directory => original_directory do #copy directory end This works fine, except when something inside of original_directory changes. The problem is that the mod date doesn't change on the enclosing directory, so rake doesn't know to copy the directory again. Is there any way to hand...

In Unix, how do you remove everything in the current directory and below it?

I know this will delete everything in a subdirectory and below it: rm -rf <subdir-name> But how do you delete everything in the current directory as well as every subdirectory below it and the contents of all of those subdirectories? ...