directories

How do I have Inno Setup update multiple locations?

I have an application that uses Inno Setup as its installer. I am now writing an updater using Inno Setup to apply some updates to various installed locations. This application can be installed on removable flash drives as a portable app and I would like to be able to roll out the updates across several drives/locations/directories for ...

How to write a Powershell function to get directories?

Using Powershell I can get the directories with the following command: Get-ChildItem -Path $path -Include "obj" -Recurse | ` Where-Object { $_.PSIsContainer } I would prefer to write a function so the command is more readable. eg: Get-Directories -Path "Projects" -Include "obj" -Recurse And the following function does exactly t...

htaccess mod_rewrite referencing to full path directories

Is it possible to reference a full/absolute path directory, such as /usr/home/public_html/x in .htaccess mod_rewrite? I've tried the most obvious case of putting the following in the .htaccess of a subdomain (stored in a folder in public_html), hoping it'd map (not redirect!) onto the file as pointed by the absolute directory: RewriteE...

How to get a single file from a folder in java?

The idea is to take one single file, but I don't want to list all the files, I have the address of the specified folder, but not the name. Basically I want findFileInFolder(String folderName) --- this method returns a random filename or the oldest file created on the folder Does anybody ever tryied doing this? any Ideas to avoid listi...

Using php to create a zip file

Hi Using the Create ZIP File PHP class I have the following line of code $createZip->get_files_from_folder('blog/wp-content/themes/', 'themes/'); Am I right in thinking that this code gets the files and sub directories from 'blog/wp-content/themes/' creates a new folder entitled 'themes', and then puts these files and sub directories...

Slashes after directory-names in various languages and configurations.

The question is really simple: should a path to a directory always contain a slash at the end? say: /path/to/directory/ over /path/to/directory. Linux/Unix seem to accept both. Most applications and libraries on linux follow this. e.g. a <Directory /home/someproject/foo/code> works just fine. In programming, say PHP I can do a dir on...

ls -ltr in perl

I want to replicate ls -ltr unix command in perl script without using backticks, exec or system. Following script is working: use strict; my $dir="/abc/xyz/log"; opendir(DIR, $dir) or die "Can not open $dir $!"; my @latest = (sort {-M $b <=> -M $a} <$dir/*>); my @latest2= grep { !/^\./ && -f "$_"} @latest; closedir DIR; Question: How ...

Active directories having problem

We are on a domain and we have an active directory implementation on our network. Now, we have expanded our network and added a back up domain controller on the network. Now, all the machines and user profiles are actually fetching their data from a DFS share instead of Domain controller itself. So we had to change all the configurati...

Get root directory in ASP Classic application

I have several relative paths in my ASP Classic application. I'd like to get a reference to the root directory of my particular application (since the root of the server is something different) for the purpose of setting paths. Is there a way to do this? ...

Win32 Perl - Telling the difference between files and folders using a passed directory argument

Hi, I'm writing a script in perl strawberry. The first thing it needs to be able to do is take a path argument and get a directory listing for that path, and it needs to be able to distinguish between files and folders. I read some tutorials on the subject and wrote the script below, but it only works when I give it the path that the s...

Advantage of placing webpages in separate directories?

My question is there really an advantage by placing each webpage in it's own directory compared to putting them in a directory? ( www.example.com/ and www.example.com/b.php ) vs ( www.example.com/ and www.example.com/b/ ) ...

Copy files from one directory into an existing directory

In bash I need to do this: take all files in a directory copy them into an existing directory How do I do this? I tried cp -r t1 t2 (both t1 and t2 are existing directories, t1 has files in it) but it created a directory called t1 inside t2, I don't want that, I need the files in t1 to go directly inside t2. How do I do this? ...

using svn to delete multiple directories at once so then I can replace them with new directories of the same name

Hey all, I find a lot of svn commands out there to delete directories and files. Unfortunately, every time I run these commands, I get strange errors afterwards like 'not under version control' or 'conflict'. I'm just looking for a straightforward svn command that will allow me to delete all the directories under the MARKT directory bel...

Python not recognising directories os.path.isdir()

I have the following Python code to remove files in a directory. For some reason my .svn directories are not being recognised as directories. And I get the following output: .svn not a dir Any ideas would be appreciated. def rmfiles(path, pattern): pattern = re.compile(pattern) for each in os.listdir(path): if os....

mysql / file hash question

Hi, I'd like to write a script that traverses a file tree, calculates a hash for each file, and inserts the hash into an SQL table together with the file path, such that I can then query and search for files that are identical. What would be the recommended hash function or command like tool to create hashes that are extremely unlikely ...

Shell Script for renaming and relocating the files

I am working on something and need to solve the following. I am giving a analogous version of mine problem. Say we have a music directory, in which there are 200 directories corresponding to different movies. In each movie directory there are some music files. Now, say a file music.mp3 is in folder movie.mp3 . I want to make a shell sc...

How to Limit The Depth of a Recursive Sub-Directory Search

I've got a function that currently grabs all folders and sub-folders to check the ACL's for a small tool I'm building but I'm pulling my hair out trying to figure out how to limit the depth that it can go to. For example you have a folder that goes 4 levels deep but I want to be able to only grab 3 levels of it for ACL's. Currently I h...

c# Cannot get list of subdirectories

Hi everyone, I've seen this code (and similar) all over the web, but I just cannot get it to work. Whenever I debug it line by line, it breaks out of debugging and loads the application. No error messages are presented, and any code after the "faulty" line remains unprocessed. Here is the offending code: foreach (string folder in allF...

createDirectoryAtPath:attributes: alternative

[NSFileManager createDirectoryAtPath:attributes:] gives me a warning that it is depreciated. What is the alternative? Or is there a better way of doing this? Thanks Tom ...

In C, how to I get to a specified directory?

I have to do a program where I need to index the files in a specified directory. I've gotten the indexing part down, but what I'm having trouble with is how to navigate to the directory. For example, say when I start the program, it will ask "What directory would you like to index," And then the input would be "usr/Documents/CS/Assignme...