directory

How can I use Perl's readdir multiple times efficiently on the same directory?

Hi all, I had a question using Perl's readdir(). I want to gather all the files in a directory that have the same prefix file name I specified. So, for each prefix, I need to use Perl's readdir() to grep all related files. Suppose the prefix is "abc", there are several files with the names "abc_1", "abc_2", etc. However, I noticed t...

How to scan a file in a different directory in java?

How do you scan a file with java that isn't in the directory the java file is in? For example: The java file is located at "C:\Files\JavaFiles\test.java" However, the file I want to scan is located at "C:\Data\DataPacket99\data.txt" Note: I've already tried putting another java file in the "C:\Data" directory and using the test.java fi...

Built in way to list directories in a directory in ruby

Is there a cleaner built-in way to do this? ree> Pathname.new('/path/to').children.select{|e| e.directory?}.map{|d| d.basename.to_s} => ["test1", "test2"] Ideally I would like to avoid the directory? call ...

PHP read sub-directories and loop through files how to ?

I need to create a loop through all files in subdirectories. Can you please help me struct my code like this: $main = "MainDirectory"; loop through sub-directories { loop through filels in each sub-directory { do something with each file } }; Can you help, plz? ...

Renaming a directory in C#

Ok, so admittedly I'm pretty new to C#, but I couldn't find a DirectoryInfo.Rename(To) or FileInfo.Rename(To) method anywhere. It pissed me off, so I wrote my own, and I'm posting it here for anybody to use if they need it, because let's face it : the MoveTo methods are overkill and will always require extra logic if you just want to re...

How to change the directory of blog posts in Drupal 6

First time user here: I am wondering how you can change the directory of blog posts from www.yoursite.com/node/... to www.yoursite.com/blog/...? ...

Webservice that handles 1 million user accounts

Imagine you're writing a web app that will have 1 million users (they all grow that big, right!) How would you handle user accounts? I can imagine a few scenarios: Roll your own (database tables, salted/hashed passwords stored in a user profile table) If written with ASP.NET, use the login/role provider (which falls back to the datab...

Change Directory in MATLAB from Terminal/JAVA

Hi all, I need to be able to change the working directory in MATLAB without interacting with the command window. I'm launching MATLAB from a Java application. Right now the only solution I've come up with is closing MATLAB, changing directory from JAVA and relaunching. Is there some streamlined way to send MATLAB the 'cd' command from J...

svn tortoise and scplugin

hi all i've encountered some problems which i can't resolve. Any help is really appreciated. my customer uses mac and pc. tortoise on pc, scplugin on mac. when mac creates new directory, adds it to repository and commits it pc user can't update to the new version. The error is "Can't create directory /.svn. The System can't find the p...

Using an index to recursively get all files in a directory really fast

Attempt #2: People don't seem to be understanding what I'm trying to do. Let me see if I can state it more clearly: 1) Reading a list of files is much faster than walking a directory. 2) So let's have a function that walks a directory and writes the resulting list to a file. Now, in the future, if we want to get all the files in t...

SVN: What to do if the empty folders in your working directory are deleted

Alright, I am working on a small app which recursively deletes empty directories. I have it under source control at Codeplex and I use TortoiseSVN to access it. So, one day, I ran it on the directory where I have all my code. And it ran fine. Empty directories were gone. But then when I tried to Commit the latest changes in any of my Su...

How to check if a dir exists in C

Hey guys, I'm relatively new to C, so forgive me if this is a stupid question, but how would I go about checking if a FILE is a directory? I have if (file == NULL) { fprintf(stderr, "%s: No such file\n", argv[1]); return 1; } and that checks if the node exists at all, but I want to know if it's a dir or a file. I've d...

SVN merge just a directory add from a checkin (without directory contents)

Hello, Am trying to merge (from a branch) a file in a directory that does not yet exist on trunk. Here is the example: Trunk (from which we branch) / /root1.txt /foo/foo1.txt Branch (after 2 checkins) / /root1.txt /foo/foo1.txt /bar/bar1.txt /bar/bar2.txt First checkin: A /bar A /bar/bar1.txt Second checkin: A /bar/bar2.t...

Objective-C #import a whole directory

Hey guys, sure hope you can help me. I've got around 50 Model-Classes stored in a seperate Folder (not only a group) and I really don't want to write an #import for each of these classes. Is there a way to import a whole directory? I know it's possible within other programming languaged and perhabs I simply used wrong syntax. Plz hel...

Unix softlinks and paths

I am somewhat confused how soft links work in unix. See the example. % cd /usr/local/ % ls -la total 6 drwxr-xr-x 2 root root 512 Jan 19 15:03 . drwxr-xr-x 41 root sys 1024 Jan 20 16:24 .. lrwxrwxrwx 1 root root 38 Jan 19 15:03 java -> /otherDir/java/jdk1.6.0_17 **<- this is a soft link** % ...

How to get innermost directory name

I am trying to output a class based on the name of innermost directory name, but can't get it right. Any help would be very much appreciated. It's a php_file_tree, please see section numbered #39 below: function php_file_tree_dir($directory, $return_link, $extensions = array(), $first_call = TRUE) { // Get and sort directories/fil...

Determining Whether a Directory is Writeable

Hi Stackoverflow, What would be the best way in Python to determine whether a directory is writeable for the user executing the script? Since this will likely involve using the os module I should mention I'm running it under a *nix environment. ...

How to test if a directory already exist in PHP?

How can i test if a directory already exist and if not create one in PHP? ...

Turn directory into Zip with PHP

How would I turn a directory into a zip file with PHP? Thanks. ...

How to make a web directory with Desciption Field?

I want to know how to you make web directory like this http://www.ibiblio.org/pub/docs/ It has a description field for each file ...