directory

rename folder into sub-folder with PHP

Hi. I'm trying to move a folder by renaming it. Both the test1 and test2 folders already exist. rename( "test1", "test2/xxx1/xxx2" ); The error I get is: rename(...): No such file or directory I assume this is because the directory "xxx1" does not exist. How can I move the test1 directory anyway? ...

How to retrieve files/documents that are not found on the web server machine.

I am trying to create an export feature for a user to be able to download documents into a zip file. I have the feature working when the files are located on my local and I can use an absolute path on my local. But after talking to the infrastructure team, I found out that the documents are not stored on the same machine as the web serve...

java hsperfdata directory

Java creates hsperfdata directory usually in the /tmp directory. What purpose does this directory serve ? What is the effect on the JVM if this directory is accidentally deleted ? ...

How can I tell what files are currently open by a process (i.e. my app)?

I am using a Lucene.Net index and want to give the user an option to move the index, but am having trouble closing it down so the directory/contents can be moved (I keep getting access denied exceptions). I need to be able to have some more information so I can debug this problem, such as being able to tell what files are currently open,...

Directory Search

This is a simple question and I am sure you C# Pros know it. If you want to grab the contents of a directory on a hard drive (local or otherwise) in a C Sharp program, how do you go about it? ...

How do i get readdir ignore directories in C/C++?

Hello all, I am reading the content of the current library with readdir, but I would like to treat only files and not directories. How do I know that I am pointing to a directory and not to a file? Thank you ...

How can I get the last modified time of a directory in Perl on Windows?

In Perl (on Windows) how do I determine the last modified time of a directory? Note: opendir my($dirHandle), "$path"; my $modtime = (stat($dirHandle))[9]; results in the following error: The dirfd function is unimplemented at scriptName.pl line lineNumber. ...

Unable to move file because it's being used by another process -- my program?

My program is unable to File.Move or File.Delete a file because it is being used "by another process", but it's actually my own program that is using it. I use Directory.GetFiles to initially get the file paths, and from there, I process the files by simply looking at their names and processing information that way. Consequently all I'...

Replace text in folder names

How can I replace the same text in folder names in linux? Say I have "Photos_Jun", "Photos_July", "Photos_Aug", etc. whats the simplest way I can rename them like "Photos Jun", "Photos July", etc (basically I want to replace the underscore with a space " ". I have about 200 of these folders. I was looking at solution: http://stackoverf...

is_dir doesn't recognize directories. Why?

I have this function: if (is_dir($dir)) { //are we able to open it? if ($dh = opendir($dir)) { //Let's cycle while (($subdir = readdir($dh)) !== false) { if ($subdir != "." && $subdir != "..") { echo $subdir; } } } This returns: dire...

How to find the real user home directory using python?

I see that if we change the HOME(linux) or USERPROFILE(windows) environmental variable and run a python script, it returns the new value as the user home when I tried, os.environ['HOME'] os.exp Is there any way to find the real user home directory without relying on the environmental variable?. Thanx. edit: Here is a way to find userhom...

Dump Contents of Directories Into Directory PHP

I have a directory like this : /images/ and then I have another directory like this /waiting/pack1/ but I have a bunch of packs, so I was wondering how I could make a script to dump all the contents of these /pack* directories into the /images/ one. ...

Directory.CreateDirectory with permissions

I would like to SET ALL permissions to True for all users of a computer, while using Directory.CreateDirectory Could you point me a point to start? ...

Stop people from viewing contents of a directory

I want to stop people from viewing the contents of my images directory. I've built an app using Codeigniter and notice that they just have index.html pages with a 403 Forbidden message in all directories - is this a secure method to use? Is an index.html page in the directory sufficient or do I need to update config or .htaccess? ...

php run function on all images from one dir in recursive mode (noob)

hey guyz i have a function $result = create_watermark( 'input_file_name' ,'output_file_name'); i have dir called /images n have 500 images in it and all images are link images_(some_unknown_numbers).png (all png) now i want run them thru function in loop and want out put like /markedimage/images_1.png images_2.png images_3.pn...

wcf and windows authentication

I like to use wcf (windows communication foundation) with windows authentication. Do I need Active directory for this purpose? How the server knows about the identity of the client? If someone can found out the pass of the client that is using the wcf services, can he create the same user name on different computer and use the passwor...

PHP Sessions data lost when changing directory?

I've got a simple login system using PHP sessions, but just recently it seems that if you visit pages not in a certain directory (/login/) you will always be flagged as not logged in, even when you are. It seems that my session data is being lost when I change directories (say, to /login/user/). I don't think I've touched the code myse...

IADS IDirectorySearch

where could i find list of attribute of an object to use in IDirectorySearch::GetColumn() i need all of attributes ...

Can a shell loop unzip all the files in a directory?

I've seen loops to unzip all zip files in a directory. However, before I run this, I would rather make sure what I'm about to run will work right: for i in dir; do cd $i; unzip '*.zip'; rm -rf *.zip; cd ..; done Basically I want it to look at the output of "dir" see all the folders, for each directory cd into it, unzip all the zip arc...

Checking if folder has files

Hi, I have program which writes to database which folders are full or empty. Now I'm using bool hasFiles=false; (Directory.GetFiles(path).Length >0) ? hasFiles=true: hasFiles=false; but it takes almost one hour, and I can't do anything in this time. Is there any fastest way to check if folder has any file ? ...