directory

Question about python modules

I have recently started learning Python and I have 2 questions relating to modules. Is there a way to obtain a list of Python modules available (i.e. installed) on a mchine? I am using Ubuntu Karmic and Synaptic for package management. I have just installed a python module.Where is the module code actually stored on my machine? (is the...

iPhone Application Documents Directory changing

Hey there, I'm building an app that allows a user to select or take a photo then it is saved as a jpeg to the app's documents directory. Everything works perfectly, however, I realized that each time I build and run the Xcode project on the device, in reinstalls the app thus creating a new documents directory path. Is there any way to...

Copy contents of Directories but excluding subdirectories in Cocoa

In Cocoa, is there any way to copy all the files in a directory without copying the directory's subdirectories along with them? ...

Shell script to test whether a directory exists and if not create it?

I am trying to create a script to detect whether a directory exists, and if it does not, to create it. How can I do that? I did some digging and found a clue: test -d directory ...will return true or false depending on whether the directory exists or not. But how do I tie this together with mkdir? ...

using svn only for a property not for entire directory

hi i want to use svn commands only for property of a directory not for the whole directory . e.g. svn revert please tell me what command is used for this purpose. thanks ...

mod rewritten directory shorten

I can only find mod rewrite examples/tutorials for query's, so can someone help me with this. I would like this http://website.tld/Folder1/Folder2/Folder3/Folder4/Folder5/File.exten to be transformed into http://website.tld/Folder4/File.exten Folder4 and Folder5 are multiple directories, while Folder 1-3 stay the same. Also File.e...

How to Open a Directory Sorted by Date?

How to Open a Directory Sorted by Date? In C#, I can open a directory for reading each file. How to I make sure that the directory I investigate in my C# code is opened such that it is sorted by last modified date? ...

windows .bat file how to recursively list all files of type *.mp3

hello i want to recursively list the absolute path to all files that end with mp3 from a given directory which should be given as relative directory. i would then like to strip also the directory from the file and i have read that variables which are in a for-scope must be enclosed in !s. is that right? my current code looks like this:...

Extracting text from a file where date -time is the index

I have got around 800 files of maximum 55KB-100KB each where the data is in this format Date,Time,Float1,Float2,Float3,Float4,Integer Date is in DD/MM/YYYY format and Time is in the format of HH:MM Here the date ranges from say 1st May to 1June and each day, the Time varies from 09:00 to 15:30. I want to run a program so that, for ea...

Sun Directory Server error replicating between 6.3.1 and 5.2

Hi, I am trying to replicate data from server A (Sun DS 6.3.1) to server B (Sun DS 5.2). On server A, using DSCC I had specified the connection to be Authentication by DN and had entered the correct DN (cn=replication manager, cn=replication, cn=config) and password. I had verified this through using command line to run the replication ...

What is the optimal way to monitor changes in a directory with a kqueue()?

OK: I'm implementing File Sharing in an iPhone OS app, and of course this means filesystem monitoring. Yay! Basically, the OS copies and/or deletes from and to a directory I can access when the user manipulates files into my app's section in iTunes. Thus, I need to monitor the directory for changes presumably via an efficient mechanism ...

How to start a process in the same folder as its executable

I'm trying to start an application programatically, but it always runs it in the folder of my application... For example: If my app is located in C:\MyApp\myapp.exe and the other app is in C:\OtherApp\otherapp.exe, how can I start the other app in the folder in which it resides, rather than in the folder where my app resides? Here is...

iPhone SDK Get tmp directory

How do i get the tmp directory on the iPhone or iPad? if i use NSTemporaryDirectory() to create a file it does not save to the simulator temp directory. ...

How to detect changing directory size in Perl

Hello, I am trying to find a way of monitoring directories in Perl, in particular the size of a directory, and upon detecting a change in directory size, perform a particular action. The issue I have is with large files that require a noticeable amount of time to copy into this directory, i.e. > 100MB. What happens (in Windows, not Uni...

How do I get path of the Directory inside my WinForm app project

I have a directory named reports inside my winform project in .net. My project name is AccountingReports and inside that Directory reports exists. So i need the way to access this path via code. In Asp.net we use Request.PhysicalApplicationPath property. So is there any method or property exists that will give me the root of my project ...

Would watching a file for changes or redundantly querying that file be more efficient?

I am wondering whether watching a file/directory for changes using the FileSystemWatcher class is extremely memory intensive. I am developing a desktop application in C# that will be running behind the scenes continuously on low-performance computers, and I need some way of checking to see if various files have changed. I can think of a ...

list all files from directories and subdirectories in Java

What would be the fastest way to list the names of files from 1000+ directories and sub-directories? EDIT; The current code I use is: import java.io.File; public class DirectoryReader { static int spc_count=-1; static void Process(File aFile) { spc_count++; String spcs = ""; for (int i = 0; i < spc_count; i++) ...

Manipulating Directory Paths in Python

Basically I've got this current url and this other key that I want to merge into a new url, but there are three different cases. Suppose the current url is localhost:32401/A/B/foo if key is bar then I want to return localhost:32401/A/B/bar if key starts with a slash and is /A/bar then I want to return localhost:32401/A/bar finally if...

How to calculate md5 checksum on directory with java or groovy ?

I am looking to use java or groovy to get the md5 checksum of a complete directory. I have to copy directories for source to target, checksum source and target, and after delete source directories. I find this script for files, but how to do the same thing with directories ? import java.security.MessageDigest def generateMD5(fin...

Determining filetype of file in assets folder

Question: How do you programmatically distinguish between directories and regular files in the assets folder? When using AssetManager to access files in the assets folder, it seems impossible to determine if a file is in fact a file or a directory. You get the list of files from the list method and then open the file using the open meth...