tagged [directory]

Delete directories recursively in Java

Delete directories recursively in Java Is there a way to delete entire directories recursively in Java? In the normal case it is possible to delete an empty directory. However when it comes to deletin...

How to get the newest (last modified) directory [C#]

How to get the newest (last modified) directory [C#] Currently my application uses string[] subdirs = Directory.GetDirectories(path) to get the list of subdirectories, and now I want to extract the pa...

31 May at 04:2

How do I find the parent directory in C#?

How do I find the parent directory in C#? I use this code for finding the debug directory `"C:\\Users\\Masoud\\Documents\\Visual Studio 2008\\Projects\\MyProj\\MyProj\\bin\\Debug"` How can I find the ...

14 Mar at 01:43

Creating a temporary directory in Windows?

Creating a temporary directory in Windows? What's the best way to get a temp directory name in Windows? I see that I can use `GetTempPath` and `GetTempFileName` to create a temporary file, but is ther...

27 Apr at 17:21

Delete files from directory if filename contains a certain word

Delete files from directory if filename contains a certain word I need to check a directory to see if there are any files whose file name contains a specific keyword and if there are, to delete them. ...

23 Aug at 21:44

How to iterate over the files of a certain directory, in Java?

How to iterate over the files of a certain directory, in Java? > [Best way to iterate through a directory in java?](https://stackoverflow.com/questions/3154488/best-way-to-iterate-through-a-directory...

23 May at 12:18

Loop code for each file in a directory

Loop code for each file in a directory I have a directory of pictures that I want to loop through and do some file calculations on. It might just be lack of sleep, but how would I use PHP to look in a...

27 May at 17:8

Unit tests for code accessing ActiveDirectory

Unit tests for code accessing ActiveDirectory What's the best way to unit test an application accessing the ActiveDirectory and/or mock the dependencies to the AD? All the required types such as `Dire...

How to find all links / pages on a website

How to find all links / pages on a website Is it possible to find all the pages and links on ANY given website? I'd like to enter a URL and produce a directory tree of all links from that site? I've l...

6 Mar at 00:18

What is the current directory in a batch file?

What is the current directory in a batch file? I want to create a few batch files to automate a program. My question is when I create the batch file, what is the current directory? Is it the directory...

4 Apr at 08:49

List all files and directories in a directory + subdirectories

List all files and directories in a directory + subdirectories I want to list every file and directory contained in a directory and subdirectories of that directory. If I chose C:\ as the directory, t...

How can I get DOMAIN\USER from an AD DirectoryEntry?

How can I get DOMAIN\USER from an AD DirectoryEntry? How can I get the Windows user and domain from an Active Directory DirectoryEntry (SchemaClassName="user") object? The user name is in the sAMAccou...

5 Jun at 14:17

How to keep the shell window open after running a PowerShell script?

How to keep the shell window open after running a PowerShell script? I have a very short PowerShell script that connects to a server and imports the AD module. I'd like to run the script simply by dou...

20 Jan at 13:49

Case sensitive Directory.Exists / File.Exists

Case sensitive Directory.Exists / File.Exists Is there a way to have a case sensitive `Directory.Exists` / `File.Exists`since and both return `true`? Most of the time it doesn't matter but I'm using a...

Check folder size in Bash

Check folder size in Bash I'm trying to write a script that will calculate a directory size and if the size is less than 10GB, and greater then 2GB do some action. Where do I need to mention my folder...

5 Feb at 20:10

How do I delete a directory with read-only files in C#?

How do I delete a directory with read-only files in C#? I need to delete a directory that contains read-only files. Which approach is better: - Using `DirectoryInfo.Delete()`, or,- `ManagementObject.I...

What are the ways to make an html link open a folder

What are the ways to make an html link open a folder I need to let users of an application open a folder by clicking a link inside a web page. The path of the folder is on the network and can be acces...

3 Jun at 10:42

How do I retrieve all filenames in a directory?

How do I retrieve all filenames in a directory? How do I retrieve all filenames matching a pattern in a directory? I tried this but it returns the full path instead of the filename. Do I have to manua...

12 Sep at 12:0

Listing all the folders subfolders and files in a directory using php

Listing all the folders subfolders and files in a directory using php Please give me a solution for listing all the folders,subfolders,files in a directory using php. My folder structure is like this:...

15 Jul at 20:28

Get members of Active Directory Group and check if they are enabled or disabled

Get members of Active Directory Group and check if they are enabled or disabled What is the fastest way to get a list of all members/users in a given AD group and determine whether or not a user is en...

30 Aug at 11:8

What is the alternative for ~ (user's home directory) on Windows command prompt?

What is the alternative for ~ (user's home directory) on Windows command prompt? I'm trying to use the command prompt to move some files, I am used to the linux terminal where I use `~` to specify the...

13 Nov at 03:9

If a folder does not exist, create it

If a folder does not exist, create it I use a `FileUploader` control in my application. I want to save a file to a specified folder. If this folder does not exist, I want to first create it, and then ...

16 Feb at 15:7

How to get the current working directory using python 3?

How to get the current working directory using python 3? When I run the following script in IDLE I get output as but when I run from cmd prompt, I get How do I get same result which I got using IDLE ?

Multiple file-extensions searchPattern for System.IO.Directory.GetFiles

Multiple file-extensions searchPattern for System.IO.Directory.GetFiles What is the syntax for setting as `searchPattern` on `Directory.GetFiles()`? For example filtering out files with and extensions...

12 Aug at 12:7

How to get folder directory from HTML input type "file" or any other way?

How to get folder directory from HTML input type "file" or any other way? So I have a basic form input with the type `"file"` however I want the user to be able to select a folder location and not a f...

17 Oct at 20:6