directory

How do I copy a folder and all subfolders and files in .NET? [duplicate]

隐身守侯 提交于 2019-12-17 21:58:09
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Best way to copy the entire contents of a directory in C# I'd like to copy folder with all its subfolders and file from one location to another in .NET. What's the best way to do this? I see the Copy method on the System.IO.File class, but was wondering whether there was an easier, better, or faster way than to crawl the directory tree. 回答1: Well, there's the VisualBasic.dll implementation that Steve references,

How to “undelete” a deleted folder in Subversion / TortoiseSVN?

微笑、不失礼 提交于 2019-12-17 21:43:10
问题 We have accidentally deleted the 'tags' folder from our Subversion repository where we only intended to delete one specific tag. What is the easiest way to get the 'tags' folder back? We use TortoiseSVN as our client and I thought that when I go to the repo browser and show log, there will be something like "revert changes from this revision" similarly to what you can see in a similar dialog on your working copy. But there is no such command there... 回答1: Just copy the deleted folder back

Accessing Directories in C

会有一股神秘感。 提交于 2019-12-17 20:42:03
问题 The program is to open a directory and to display the name of the files... i.e if there is a file..it should say FILE....else DIRECTORY.. but the program displays all the files as directory.. Could anyone pls check the code for any errors....thnx #include<stdio.h> #include<dirent.h> #define DIR_path "root/test" main() { DIR *dir; dir=opendir(DIR_PATH); printf("THe files inside the directory :: \n"); struct dirent *dent; if(dir!=NULL) { while((dent=readdir(dir))) { FILE *ptr; printf(dent->d

Java - How to change icon of folder

大憨熊 提交于 2019-12-17 20:40:07
问题 So how do I change the icon of a folder in Java (Windows system) is there a class or something cause I have searched and I can't find anything... 回答1: Based on the comments, the folder icon that you are talking about is specified in a hidden "ini" file in the folder itself. You could create / modify the file by reading it as text, etcera, but it is simpler to use an existing 3rd-party Java library. I've had success using the open-source ini4j Java library. 回答2: I did that using ini4J and It

android: determining a symbolic link

柔情痞子 提交于 2019-12-17 19:45:09
问题 I am scanning all directories starting from "/" to find some particular directories like "MYFOLDER". However, the folder is that I get double instances of the same folder. This occurs because one folder is located in "/mnt/sdcard/MYFOLDER" and the same folder has a symbolic link in "/sdcard/MYFOLDER".. My Question is, "Is there any way to determine whether the folder is a symbolic link or not?". Please give me some suggestions.. 回答1: This is essentially how they do in Apache Commons (subject

How to write a list sorted lexicographically in a grid listed by column?

不羁岁月 提交于 2019-12-17 19:25:36
问题 I have the result of Get-ChildItem , and I want to iterate over these, and display their names. By default if I simply use Write-Host then I get it listed out along the row like this: PerfLogs Program Files Program Files (x86) Python31 Temp Users Windows However, say that I know I want it split into x columns, I want the output like this instead: PerfLogs Python31 Windows Program Files Temp Program Files (x86) Users As you can see, it lists it down the columns first, and then across. Any idea

Detect empty directory with Perl

情到浓时终转凉″ 提交于 2019-12-17 19:19:11
问题 What is an easy way to test if a folder is empty in perl? -s, and -z are not working. Example: #Ensure Apps directory exists on the test PC. if ( ! -s $gAppsDir ) { die "\n$gAppsDir is not accessible or does not exist.\n"; } #Ensure Apps directory exists on the test PC. if ( ! -z $gAppsDir ) { die "\n$gAppsDir is not accessible or does not exist.\n"; } These above, do not work properly to tell me that the folder is empty. Thanks! Thanks all! I ended up using: sub is_folder_empty { my $dirname

Listing only files in directory [closed]

回眸只為那壹抹淺笑 提交于 2019-12-17 19:15:36
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I have a folder with following structure C:/rootDir/ rootDir has following files test1.xml test2.xml test3.xml testDirectory <------- This is a subdirectory inside rootDir I'm only interested in the xml Files

zip/compress a folder full of files on android

余生长醉 提交于 2019-12-17 18:17:14
问题 I need to zip up a "project" folder to allow users to share projects via email. I found a class for zipping up multiple files into one zip, but I need to keep the folder structure in my zip. Is there any way to achieve this on android? Thanks in advance. 回答1: This code should do the trick. Note: you must add file write permissions to your app by adding the WRITE_EXTERNAL_STORAGE permission to your manifest.xml file. /* * * Zips a file at a location and places the resulting zip file at the

Auto refresh eclipse project upon folder update

◇◆丶佛笑我妖孽 提交于 2019-12-17 18:14:43
问题 I want to know if there is a way to enable auto refresh of eclipse project whenever there is an update on the folder consisting project files. For instance when i update the files from version control such as SVN,or if i include files from my friend etc. I know we can simply refresh the project or use SVN plug in as such ,but i am simply curious as to folder update notifications. Thanks in advance 回答1: Yes , Eclipse version 3.7 has the new lightweight refresh mechanism to keep the workspace