directory

What datatype/structure to store file list info?

I have an application that searches files on the computer (configurable path, type etc). Currently it adds information to a database as soon as a matching file is found. Rather than that I want to hold the information in memory for further manipulation before inserting to database. The list may contain a lot of items. I consider performa...

Copying files from one directory to another in Java

Hello, I want to copy files from one directory to another (subdirectory) using Java. I have a directory, dir, with text files. I iterate over the first 20 files in dir, and want to copy them to another directory in the dir directory, which I have created right before the iteration. In the code, I want to copy the review (which represent...

Get actual folder path

How I can get actual folder path where my program is without my exe file name in C++? ...

Problem with creating a directory in Java

Hello, I am trying to create a directory in Java. I think I have provided correctly all necessary things so that I make the directory, but it is not created. You can see from my code below and the corresponding output that every element from which I compose the path of the new directory should be correct and valid. It seems, however, th...

PHP- making a fake directory!

I have been looking at some sites that pretend that there is a directory structure in the URL and wondered 'how?'. I am taking control of a website at work and have looked over the code. They have a database for all the pages and they are created dynamically. I can get the homepage working on my local server but i dont have a clue as...

Makefile Pattern Issue

My compressed audio cafs, which should be copied by the 4th rule below, are being processed prematurely by the second rule because Assets/Audio/Compressed/Blah.caf matches the second rule (but I only want files in Assets/Audio (no deeper) to be handled by this rule). Ideas? I don't really want to simply change the rule order (as I think ...

Making php includes work in a sub-directory.

Ok, I am creating an admin interface for my custom blog at the url /admin. Is it possible for me to be able to use the same includes (including autoload), as the root directory. If possible, I would also like to be able to automatically correct the links in the navigation so that they go that index.php in / changes to ../index.php when...

Error due to encryption in the command "cp -R /Users/me/cs_project /Users/cs/"

Problem: to copy a directory tree from the "me" master user to the encrypted harddrive of the "cs"-user: su cs bash-3.2$ cp -R /Users/me/cs_project /Users/cs/ cp: /Users/cs/cs_project: Permission denied cp: /Users/me/cs_project/h_mark: unable to copy extended attributes to /Users/cs/: Permission denied cp: /Users/cs/: No such file or ...

Checking if a directory exists on another server in ksh

I am trying to verify if a directory exists prior to moving a file in Korn, using the classic: if [[ -d ${dir} ]]; then scp file else exit 12 fi My Problem: That the directory is on another server, so whenever I check, the script can't find it and therefore fails and exits every time. My Question: Is ther...

Batch Scripting, For using the results of a dir

Hi All, I'm trying to write a small batch script that will delete files old files from a directory. The first parameter is the directory for the script to look into, and the second is the number of files to preserve. rem @ECHO OFF rem %1 is the path in which to look for the files rem %2 is the number of recent files to preserve if [%...

groovy zipping a directory with files in use

I am trying to zip an entire directory in a groovy program. I have used the built in ant target to zip the directory and normally this works, except that sometimes 2-3 files are in use which I don't care about but the zip code actually aborts because of that - any ideas on how to fix this? Thanks! Code: def ant = new AntBuilder() an...

is_dir check is not working

I'm having some problems using / understanding is_dir. (Yes, I have read the PHP doc). I have a baseDIR as following: $baseDIR = 'I:\Development\wamp\www\mySite\wp-content\uploads\' The following code is TRUE and therefore outputs the text: if (is_dir($gallery->baseDIR)) echo 'DIR exists'; Now I need to check if there is a dire...

Give no one access in a directory .htaccess

Hi It is probably very simple but I can't find it. I want to make a .htaccess file so no one can get into the folder. except for the php on the server. does anyone know the code line? Thanks Matthy ...

How to filter files when using scp to copy dir recursively?

I need to copy all the .class files from server to local with all dir reserved. e.g. server:/usr/some/unknown/number/of/sub/folders/me.class will be /usr/project/backup/some/unknown/number/of/sub/folders/me.class the problem is, there are many other useless files such as .svn-base files that i don't want. how can i filter them so I only ...

scp -r ... but leave out (exclude) a specified subdirectory

Here's the directory structure: /a/ /a/b/ /a/c/ I want to copy everything, EXCEPT for the /a/c/ subdirectory. scp -rp myserver:/a . # this will copy everything Q: How would I specify a directory to leave out in the scp command ? ...

Virtual Directory in Azure Web Role

Is there a way to create a Virtual Directory in Azure web role. I know you can create them programmaticly on a normal instance of IIS 7, but you have to assign a physical path. How is that possible in Azure? ...

find string inside a gzipped file in a folder

My current problem is that I have around 10 folders, which contain gzipped files (around on an average 5 each). This makes it 50 files to open and look at. Is there a simpler method to find out if a gzipped file inside a folder has a particular pattern or not? zcat ABC/myzippedfile1.txt.gz | grep "pattern match" zcat ABC/myzippedfile2....

Git: Renaming a directory in a branch

I have a project using Git where I've branched off of master to rename a directory. The rename in the branch works as expected. When I switch back to the master branch the directory has its original name, but there's also an empty directory tree with the name that I changed it to in the branch. Is this the expected behavior? Am I missi...

How to get a given user's AppData directory in C#?

Is it possible to get the application data directory for a given user who is NOT the user running the program in C#? ...

How to list text files in the selected directory in a listbox?

How can I list the text files in a certain directory (C:\Users\Ece\Documents\Testings) in a listbox of a WinForm(Windows application)? ...