I want to copy the file c:\a1\b2\c3\foo.txt to d:\a1\b2\c3\foo.txt. The subdirectories don't exist on the D drive, and if I try to do a direct CopyTo() I'll get an IO exception.
I haven't been able to find any built-in c# function that does the dirty work of creating the missing directories. So I wrote this:
FileInfo file = new FileInf...
In my Hg repository (at Google Code) I have a directory that shouldn't be there. Basically I decided to move everything into a sub-directory (I had everything in the root), which worked fine but now there's a couple of 'dead' directories. Its my understanding HG works off files rather than tracking directories so I think that's what's ha...
Here is the code I have thus far:
import java.io.*;
class JAVAFilter implements FilenameFilter {
public boolean accept(File dir, String name) {
return (name.endsWith(".java"));
}
}
public class tester {
public static void main(String args[])
{
FilenameFilter filter = new JAVAFilter();
File directo...
I have written a Perl script which opens a directory consisting of various files. It seems that the script does not read the files in any sequential order (neither alphabetically nor size wise) instead it reads them randomly. I was wondering what could be the reason behind the same?
...
If I choose lots of files tactics,
then I become to have directory
traversal security problem?
I need to write login system,
and lots of file tactics means
make lots of id files and use
scandir.
so the directory would have
aaa.txt (contents is aaa_pass)
bbb.txt (contents is bbb_pass)
ccc.txt (contents is ccc_pass)
and when some...
Hi
I want to scan a directory tree and list all files and folders inside each directory. I created a program that downloads images from a webcamera and saves them locally. This program creates a filetree based on the time the picture is downloaded. I now want to scan these folders and upload the images to a webserver but I´m not sure how...
I was recently tasked with architecting a new scalablable user phone directory. Basically you'll have phone resellers logging into a portal and selling their phones to customers (who also need to be added into the system). So if I bought 3 phones from the reseller for my family, then each phone is automatically on the network (done by ...
Hi,
For many years, I have been programming in a simple way: I would save my source files in directories organized by language and project, make the occasional manual backup, and if I’m smart, I make a copy before trying out a new version; that’s pretty much it.
I recently decided to begin using revision control. After examining a bunc...
Hi There,
I want to build something where the user to browse the local files on the application I am providing, the screen is actually identical to OpenFileDialog, but I do not want that to be a dialog but a control on my form.
I tried to use a Web Browser control, it works, but I have to write a bunch of navigation code in order for t...
I have split a large text file into a number of sets of smaller ones for performance testing that i'm doing. There are a number of directories like this:
/home/brianly/output-02 (contains 2 files myfile.chunk.00 and myfile.chunk.01)
/home/brianly/output-04 (contains 4 files...)
/home/brianly/output-06 (contains 6 files...)
It's import...
Hi;
In ClearCase, you can list the content of a directory using "cleartool ls".
My question is how can I do the same thing using CAL (ClearCase Automation Layer). The reason I prefer the COM API is because I won't have to parse the output of "ls".
So far, I am able to get the VOB and the View successfully, but I didn't find any method...
When I navigate to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\myfirstproject\202aebd2\f0e764e2\assembly\dl3 in Windows explorer, there are 108 folders with 8 character hexadecimal names. Explorer won't sort this folder by name (or value ). What gives?
...
Hello,
When building a project in Xcode (3.1.2), 2 folders are automatically added as header directories with the '-I' option:
/ (ProjPath) / (ProjName) / build / (BuildConfigName) / include
/ (ProjPath) / (ProjName) / build / (ProjName).build / (BuildConfigName) / (ProjName).build / DerivedSources
I realized this when trying to ...
I want to check if a file path is in a given directory (or one of its subdirectories), from PowerShell.
Right now I'm doing:
$file.StartsWith( $directory, [StringComparison]::InvariantCultureIgnoreCase )
but I'm sure there are better ways.
I could do take $file.Directory and iterate over all .Parents, but I was hoping for something...
I have a network folder which can contain up to 10,000 files (usually around 5000).
What is the fatest way I can get the filepath of the most recently created file in that folder using c#?
Currently I am using the below, but wondered if there was a quicker way.
Thanks.
DirectoryInfo di = new DirectoryInfo(xmlFileLocation);
var feedFi...
Given a path, say, /home/xyz/abc/def, I would want to determine if def is a directory or a file. Is there a way of achieving this in my C++ code?
...
I have a big solution with ~30 projects(it's not my fault). I have several versions of boost. Each solution uses it's own version of boost. For now boost is set for each project(30 times).
How to set boost on solution level? I want to say this solution uses boost_1.39, this solution uses boost_1.33.
I can add path globally on VisualStu...
Directories some_folder, some_folder_1, some_folder_2, and some_folder_3 don't exist initially.
File folder1 = new File("some_folder/some_folder_1");
File folder2 = new File("some_folder/some_folder_2");
File folder3 = new File("some_folder/some_folder_3");
if(!folder1.exists()) {
folder1.mkdirs();
}
if(!folder2.exists()) {
...
Is there a function in Perl that lists all the files and directories in a directory?
I remember that Java has the File.list() to do this? Is there a comparable method in Perl?
...
In Perl, how can I create a subdirectory and, at the same time, create parent directories if they do not exist? Like UNIX's mkdir -p command?
...