directories

Problem: .NET code runs from one directory, but not another, on same disk

Our application is a hybrid Win32 unmanaged application and a .NET 2.0 managed application. The Win32 part is the main executable, which at some point loads and hosts the .NET 2.0 runtime and loads some managed modules to open new winforms windows. We've had our share of CASPOL-type problems, but today we have a very odd problem and I'm...

How do I distinguish a file from a directory in Perl?

Hi, I'm trying to traverse through all the subdirectories of the current directory in Perl, and get data from those files. I'm using grep to get a list of all files and folders in the given directory, but I don't know which of the values returned is a folder name and which is a file with no file extention. Does anyone know how to tel...

How to get date/time when file was placed in a directory on Windows?

Is there a way to tell when a file was moved to a certain directory? I'm being asked why a script of mine did not find a file in a certain directory. The file was created last January but I suspect it was placed in the directory after the script was run. Is there a way for me to confirm my suspicion? Viewing the file properties gives...

.NET How to check if path is a file and not a directory?

I have a path and I need to determine if it is a directory or file. Is this the best way to determine if the path is a file? string file = @"C:\Test\foo.txt"; bool isFile = !System.IO.Directory.Exists(file) && System.IO.File.Exists(file); For a directory I would reverse the logic. string directory = @"C:...

PHP list directories and files

What would be the easiest way to have a page where it will display a list of directories that the user can click on to open, where there will be more directories or eventually files to download and have it all happen on the same page? ...

Can I move the .git directory for a repo to it's parent directory?

I have two sub-directories each with a repo, thus : PPP/ |--ABC/ | |--.git/ | |--AAA/ | | BBB/ | | CCC/ | |--DEF/ | |--.git/ | |--DDD/ | |--EEE/ And would like to combine them into one repo, so, I would assume the directory structure would be like this: PPP/ |--.git/ |--ABC/ | |--AAA/ | |--BBB/...

linux, directories, where should stuff go

I'm currently trying to get to grips with using linux. I'm running mint linux (an ubuntu variant). When I install something using apt-get, files seem to get scattered across various system directories at random (system meaning not my home directory), of course I know this isn't at random it just seems this way at the moment. However if...

Running files in a directory recursively using ruby.

I'm working on script right now which has to run each ruby script in a directory and its subfolders. e.g. run-all.rb - scripts - folder1 - script1.rb - script2.rb - folder2 - script3.rb - script4.rb As the server is a Windows server I would normally use a batch file but the head dev insists everything must be don...

How can I create a directory if one doesn't exist using Perl?

Currently, my Perl output is hard-coded to dump into the following UNIX directory: my $stat_dir = "/home/courses/".**NEED DIR VAR HERE**; The filename is built as such: $stat_file = $stat_dir . "/".$sess.substr($yr, 2, 2)."_COURSES.csv"; I need a similar approach to building UNIX directories, but need to check if they exist first b...

Will 20 year old compatibility issues exist 20 years in the future?

There is nothing like the 43rd day of your life spent tracking down issues due to CR/LF, different slash types, or a Big Endian vs. Little Endian bug. These issues are 20 years old and they make me feel as though humans are still cavemen. Are we simply replacing these old issues for new ones? XML has helped but aren't these issues cos...

how to create a sub directory inside a directory

In other words, i have temp folder where i store my extracted files. How do i create a folder in that temp folder so that all files are extracted or unzipped in this folder, which is inside the temp folder? ...

Sorting a list with paths by deepest directory

Hello. I need to sort a list that contains paths (relative or absolute) so that the deepest path appears first, for example: \New Folder\Item1\tools\1 \New Folder\Item1\tools \New Folder\Item1 \New Folder etc... Is there an API in Path class I can use to do it? Thanks! J. ...

Hiding Directories Programatically in C#

I want to make a directory hidden in Windows Vista. Not hidden completely just from view. Like you set from the folder options. I tried something along the lines of an example I saw. Only I modified it slightly.. Here is all of my code combined. using System; using System.Collections.Generic; using System.ComponentModel; using Syst...

How to tell whether a file system object is a path or a directory

Possible Duplicate: .NET How to check if path is a file and not a directory? Hi, Can anyone think of a good way of telling whether a file system object path equates to a a file or a directory? I did have the following method: public static bool PathIsFile(this string fullPath) { return (Path.GetExtension(fullPath).Length ...

C#: How to open Windows Explorer windows with a number of files selected

In the Library of Windows Media Player you can select one or more music files. You can then right-click and in their context menu choose Open File Location. This will open up one windows explorer window for each directory that the files are in, and the files will be selected for you. So let's say we have a bunch of mp3 files in our lib...

mod_rewrite rules

I'm trying to get the data after the URL and sent back to the home page. I have had errors in the .htaccess file on one server so I am trying it out on another server. The links down the side of http://www.newbiemoneymakers.com/bank/ should do directly to http://www.newbiemoneymakers.com/bank/index.php where I then get the title. My .h...

Can this code to loop through photos in a folder be optimised?

I have written this code having not used PHP for 2 years now to loop through a folder of photos and write them to the page in alphabetical order. It is a fairly simple request but it took me the best part of 15 minutes to write. if ($handle = opendir('photos')) { $count = 0; $list[] = array(); while (false !== ($file = readdir($ha...

Copying files to directories as specified in a file list with python

I have a bunch of files in a single directory that I would like to organize in sub-directories. This directory structure (which file would go in which directory) is specified in a file list that looks like this: Directory: Music\ -> 01-some_song1.mp3 -> 02-some_song2.mp3 -> 03-some_song3.mp3 Directory: Images\ -> 01-some_i...

Removing .svn files from all directories

I recently converted my cvs repository to svn using cvs2svn and I recently noticed that every directory has a hidden folder called .svn. My current build script copies a lot of directories from my versioned resources directories and it ends up copying the .svn files. Is there anyway to make svn not include these files when I checkout o...

How do I view application directories and directories that begin with dot in Netbeans on OSX?

How do I view directories that begin with dot and how do I browse application directories in Netbeans? I can't seem to view directories that begin with a "dot" through the open file dialog in Netbeans. Similarly, I can't browse any application directory e.g. File->Open File->"someapp.app". Attempting to browse "someapp.app" gives the er...