directory

Create a temporary directory in Java

Is there a standard and reliable way of creating a temporary directory inside a Java application? There's an entry in Sun's issue database, which has a bit of code in the comments, but I wonder if there is a standard solution to be found in one of the usual libraries (Apache Commons etc.) ...

Enhanced Directory Browsers on Webservers

Hey guys and gals, I'm looking for free webserver directory browser enhancements similar to: http://www.daleanderson.ca/edb/ Servers I'm interested in are Apache2, nginx, and lighttpd, but was having trouble finding any on Google. If anyone knows of any, I'd be grateful if you shared a link :) Thanks. ...

How to get path to Desktop for current user in C# ?

This should be a no brainer, but somehow I can't persuade Google to give me a decent answer. The only think I could find is the VB-only class SpecialDirectories, which has this property: My.Computer.FileSystem.SpecialDirectories.Desktop How can i do this in C# ? ...

Visual Studio projects with multiple folders

Is there an easy way to use multiple folders in a project with Visual Studio? It has "filters" which look like folders, but it would be really nice to be able to make folders and insert files in them inside VS. Is there an add-in or secret option to enable this behavior? ...

Win32 current directory, locking & shell integration

In Win32, your main thread's current working directory is set to the location the executable was launched from. My problem is that even after a call to SetCurrentDirectory() to somewhere else, the process apparently still has a filesystem object referencing this initial startup directory (verifiable with a tool like Process Explorer) - w...

Get the hierarchy of a directory with PHP

I'm trying to find all the files and folders under a specified directory For example I have /home/user/stuff I want to return /home/user/stuff/folder1/image1.jpg /home/user/stuff/folder1/image2.jpg /home/user/stuff/folder2/subfolder1/image1.jpg /home/user/stuff/image1.jpg Hopefully that makes sense! ...

Installer does not ask to create a new directory?

(sorry, not exactly a coding question) Say I want to install something to the directory C:\pony but the folder 'pony' does not exist, how can I get InstallShield to inform the user that the folder 'pony' does not exist and ask the user if he or she wants to create the directory. What happens now is the directory is automatically create...

Best/Easiest/Quickest way to get relative path between two files?

I'm in the midst of some refactoring some C# code and part of this is to redo some references, because we're redoing the folder structure entirely. What I'd like to do is just go into the .csproj or .sln file and modify the paths. However some of the references have paths like "../../../../../../ThirdParty/SomeMicrosoftLibrary/bin/Debu...

Good reasons to pass paths as strings instead of using DirectoryInfo/FileInfo

In my new code I am not using strings to pass directory paths or file names. Instead I am using DirectoryInfo and FileInfo as they seem to encapsulate a lot of information. I have seen a lot of code that uses strings to pass directory information then they "split" and "mid" and "instr" in long incomprehensible statements until they get...

get directory from full path

If i have: C:\temp\foo\bar\ (NOTE: bar is a directory) how can i parse out: bar ...

How to get the lists of file and directory names of a site?

How exactly do you do this? The reason is my CMS has been breached, well, mainly because the username and password is fairly common (my bad). But I've always thought that it is save, since the directory name is pretty un-common and hard to guess (not the usual /cms/ or /admin/). Brute-forcing from a script? or maybe some Google tricks? ...

Windows batch file starting directory when 'run as admin'

I have a batch file which is in a directory and must be run from there as well because it updates files within this directory. This works perfectly fine, except when the user runs the batch file as administrator (required on Vista). Then the starting directory is C:\Windows\System32. Is there any way to still be able to know from which d...

C# Why is my code throwing a io.system.directorynotfound?

Hi all, Why would the code below throw a io.system.directorynotfound exception? I can't recreate the problem myself but another user of my code does see it, any ideas why? Thanks try { //create path string strAppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).ToString() + "\\MyApp\\Data\\logs"; //check...

How do I get the directory from a file's full path?

What is the simplest way to get the directory that a file is in? I'm using this to set a working directory. string filename = "C:\MyDirectory\MyFile.bat" In this example, I should get "C:\MyDirectory". ...

Using forms with the Zend Framework

I'm relatively new to MVC and the Zend Framework. That being said, I feel like I have a hard time figuring out where Forms belong in my directory structure. I have a modular directory structure, so I don't know if there should be a single forms directory, or one within each module directory. /application /modules/ /default ...

How can I create directory tree in C++/Linux?

I want an easy way to create multiple directories in C++/Linux. For example I want to save a file lola.file in the directory: /tmp/a/b/c but if the directories are not there I want them to be created automagically. A working example would be perfect. ...

Unable to get the size of a directory by ls

I run the command unsuccessfully to get the size of directories (files inside belong to the size of a directory) ls -lSrh I get only kilobits for the size of directories while their content is more than that. How can you list the size of directories including their content in the number by ls? ...

Counting the number of files in a directory using Java

How do I count the number of files in a directory using Java ? For simplicity, lets assume that the directory doesn't have any sub-directories. I know the standard method of : new File(<directory path>).listFiles().length But this will effectively go through all the files in the directory, which might take long if the number of files...

How to get upper paths from a single path?

How to get upper paths from a single path? So say you have a path like: 'C:\a\b\c\d\' How do I get to 'C:\a\b' or 'C:\a\b\c' Is there a pythonic way to do this? ...

git status - is there a way to show changes only in a specific directory?

I would like to see a list of files modified since the last commit, as 'git status' shows, but I care only about files located in a single directory. Is there a way to do this? I tried 'git status <directory>', but it seems this does something completely different (lists all changed files, as they would be if I wrote 'git add <directory>...