directory

Mimic Context.getExternalFilesDir() prior to Android API Level 8?

Android API level 8 introduced the Context.getExternalFilesDir() method, providing a File object reference to an SD card path specific to your app. I am wondering how to mimic this as low as API level 5. I see there is a Context.getDir() method, but I can't tell from reading about it how this differs. ...

How to durably rename a file in POSIX?

What's the correct way to durably rename a file in a POSIX file system? Specifically wondering about fsyncs on the directories. Note: there are other questions on StackOverflow about durable renames, but AFAICT they don't address fsync-ing the directories (which is what matters to me - I'm not even modifying file data). I currently ha...

Command to find all files in a directory and concat them for a parameter?

Hi, I'm looking for a command which finds all files in a directory using a specific partern, lets say "*.txt" and create a list of parameters from it in BASH. So if the dir contains: file1.txt file2.txt file3.txt nonsense.c I need the string "file1.txt file2.txt file3.txt" I knew there was a BASH/Unix command for this, but I can't re...

How can I list all files in a directory using Perl?

I usually use something like my $dir="/path/to/dir"; opendir(DIR, $dir) or die "can't open $dir: $!"; my @files = readdir DIR; closedir DIR; or sometimes I use glob, but anyway, I always need to add a line or two to filter out . and .. which is quite annoying. How do you usually go about this common task? ...

How do I open a C file with a relative path?

I am trying to parse a txt file and I want to reference it relative to my current directory location. If I put the file path in completely it will work but it I try to use ..\src\test.txt it wont find it. Is this not the proper way to reference a file relative up one directory? Any help would be appreciated ...

Need help implementing multithreading into my TreeView (C#, WPF)

Okay, I have a TreeView that serves as a directory tree for Windows. I have it loading all the directories and functioning correctly, but it is pausing my GUI while it loads directories with many children. I'm trying to implement multithreading, but am new to it and am having no luck. This is what I have for my TreeView: private readon...

Get files from directory with pattern.

Hello, Does it possible to get for ex. .c and .hfiles from directory. Usage of Directory.GetFiles("C:\", ".c;.h"); does not work. It's too bad to invoke Directory.GetFiles(...); twice.. :( Thanks. ...

Plugin Suggestions - Wordpress as a Membership Directory

I've been trying struggling over the last 2 weeks to find a viable way to configure a Wordpress installation as a membership directory that pulls information from user profiles (custom and default) and displays it in a presentable (possibly sortable) format. Initially, something along the lines of the Sobi2 plugin for Joomla! was search...

What is the URL of the website that shows the technology used and allows to search for websites for each technology/script.

I remember that I saw some resource that allowed to see which technology is used on each website. e.g. in Linux with php and the especially it gave information about the scripts that website utilize. e.g. Google Analytics, Google Adsense, Tribal Fusion, jQuery... Also it was possible to see all websites that use each (or groups of) tech...

Error getting images to show up in Symfony 1.4.8.

Note: It was tough deciding whether this belonged here or ServerFault, but it seemed like a programming problem, so if it's out of place, feel free to migrate it. I downloaded the sandbox of Symfony 1.4.8 and copied the files to my webserver. Unfortunately, when I try to access /symfony/sf_sandbox/web/ (where I installed it), I get the ...

PHP list all files in directory

I have seen functions to list all file in a directory but how can I list all the files in sub-directories too, so it returns an array like? $files = files("foldername"); So $files is something similar to array("file.jpg", "blah.word", "name.fileext") ...

Checking if a directory exist in Unix (system call)

Hello, I am not able to found a solution to my problem online. I would like to call a function in Unix, pass in the path of a directory, and know if it exists. opendir() returns an error if a directory does not exists, but my goal is not to actually open, check the error, close it if no error, but rather just check if a file is a direc...

Why is git adding my directories as though they were files?

It might be a lack of coffee, but I've just had some, so I'll go ahead and ask anyway. Here's a literal talk that I had with my terminal, with line breaks for readability. $ ls -la total 28 drwxr-xr-x 5 thomas thomas 4096 2010-10-02 09:32 . drwxr-xr-x 153 thomas thomas 12288 2010-10-02 09:30 .. drwxr-xr-x 5 thomas thomas 4096 201...

Why does this go into an infinite loop?

Okay, so I'm trying to create a list of he folders, and sub-folders and their files, but right now it doesn't print anything, and seems to be going into an infinite loop. Any idea why? //infinate loop start for(int j = 0; j < (int) dirs[i].folders.size(); j++){ dirs.push_back(Directory(dirs[i].folders[j])); ...

How can I generate a directory tree from a root folder and all it's sub folders?

okay, so I'm trying to get a directory of folders and sub folders, but it just goes into a infinite loop. What is a better way to create a directory of folders and sub-folders? Cause I really have no idea. this is my code so far: #include <sys/types.h> #include <sys/stat.h> #include <dirent.h> #include <errno.h> #include <vector> #incl...

how to create a directory in sdcard

hello guyz i have been trying to create a directory in sdcard programatically but it always showing me directory not created. my code is this. boolean success = (new File("/sdcard/map")).mkdir(); if (!success) { // Directory creation failed } Log.i("directory not created", "directory not created"); ...

Testing Username / Password against Active Directory Domain in VBScript?

I need to test a username and password pair against a given domain in a VBScript. The script will know the username, password, and domain against which it needs to check for access, and all I need returned is a true or false as to whether the account is valid. Can anyone suggest a good way to accomplish this? Thanks! ...

MsBuild: Get current directory of targets

I have a msbuild target and it has a Import tag like this: <Import Project="$(MSBuildExtensionsPath)\Company\Company.LifeCycle.targets" /> In contents of Company.LifeCycle.targets file, how can I get programatically the current directory (in this case is: C:\Program Files\MsBuild\Company) ?? I use VS 2008, .NET 3.5 Edit: I have seen...

Binary structure for a directory with files

Hi guys, I'm trying to solve the following problem. I want to create a set of directories with files in them , but in memory using C# , using strings / byte arrays, and I am trying to figure out what's the format and byte sequence for all of this. i mean something like <magic sequence for top directory header> <magic sequence for file ...

Install directory from deployment projects

Hello all, I'm developing an application and I'm going to deploy it with the help of a deployment project (which is gonna create an installer). At one step in the installer, it will allow the user to change the installation folder for the application. I need to know what this folder is because there will be some files saved there that...