directory

Directory.Delete(path, true) always gives error - ASP.NET 3.5 MVC

Hi, I'm using MVC ASP.NET 3.5 and I'm trying to delete a folder with all files within using standard .NET method that I've always used in .NET 2.0. I found this but the first answer doesn't seem to work. I've tried this one try { Directory.Delete(path, true); } catch (IOException) { Thread.Sleep(0); Directory.Delete(path, t...

How can I Compress a directory with .NET?

I have a directory that contains several files. I want compress this folder to a zip or tar.gz file. How can I do his work in C#? ...

Delete Old directories in Python

Hello, I have several directories and I want directories over 7 days old to be deleted. I have code already implemented but It doesn't seem to be working. Can anyone see where I am going wrong? def delete_sandbox(): for directories in os.listdir(os.getcwd()): if not os.path.isdir(directories) or not os.stat(directories)....

Creating directories from filename?

Hi! I'm creating website that handles "great amount" of images. I have decided to use multiple directories method for storing files eg. images/efg/ed/ehj/efgedehjokjvdf2jn4.jpg I'm thinking that to prevent filename duplication is to take current timedate + some random string + md5 those = nice line of random string. Mostly I'm wonderin...

How to check contents of a folder using Python

How can you check the contents of a file with python, and then copy a file from the same folder and move it to a new location? I have Python 3.1 but i can just as easily port to 2.6 thank you! ...

"Unix directories are lists of 'link' structures"

From http://en.wikipedia.org/wiki/Inode Unix directories are lists of "link" structures, each of which contains one filename and one inode number. I'd like to just get the length of this list of links, the names of the files in the directory aren't important at this point in my code. A solution in Perl would be preferred, but ...

Apache access control: Interaction between <Directory> and Order/Allow/Deny

Apache's Order/Allow/Deny directives are permitted within a <Directory> context. What happens when a set of these directives is present within a <Directory> for the current directory and within a <Directory> for a parent? http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#order gives an order - Allow and Deny are evaluated dependi...

Read Permissions to a directory in C#

I've noticed if you change the security settings for a particular directory, you can make that folder no longer "browsable" in windows. In particular, changing the "Read" permission for Administrators to "Deny" will make that folder inaccessible. The question I now have, is how do I figure this out in code? I following gets me close, ...

Django upload file into specific directory that depends on the POST URI

I'd like to store uploaded files into a specific directory that depends on the URI of the POST request. Perhaps, I'd also like to rename the file to something fixed (the name of the file input for example) so I have an easy way to grep the file system, etc. and also to avoid possible security problems. What's the preferred way to do th...

android shared directory with read and write access

How do I create a shared directory with read/write permissions to all applications installed on my phone and that is not on the sdcard? I tried that : File f = new File("/tmp"); f.mkdir(); but it is not working. ...

how to count files? (iphone sdk)

Hi all, does anybody know how to count files of a directory? I couldn't find something similar in the class reference of NSFileManager. Thanks in advance. Sean ...

Which directories are writable by web server on shared web-hosting?

Currently I'm using shared webhost (Linux) to host my site. I know that anything inside '~/home/my_user_name/www' directory is writable by server. What are the other locations? Basically I want to change default session storage location and probably I shouldn't put it inside www directory. Edit Does session saving location has to be w...

Terminal: Opening the current path in a window?

Often times, I find myself navigating very deep into a directory and wanting to open the graphical window (nautilus) for various reasons. So the question is simple: After doing, cd sampledirectory cd sampledirectory2 How can I open this location in a GUI? ...

running with Java.exe when period exists in directory name

Hi, I am trying to run the java prog I've built, but I want to run it from a specific directory. When specifying the relative path to the class file I want to run, that path contains a directory with a period in it, and it seems to be tripping java up; So for example I try to run: java -classpath myPath/myPath-1.2.3/myLongPath myPath/m...

How I can specify directories in war file ?

Dear all, I am new to servlet . I use the following code in servlet.then deployed to Jboss 4.1 . backup_database_configuration_location is location of properties file.But it can't be find. how I can specify directories in war file ? Thanks all in advance try { backupDatabaseConfiguration = new Properties(); FileInputStream backupDa...

How Do I Rotate Listings for my Business Directory?

I have a directory that lists local businesses in the area. How do I make it so the listings appear in different order every time a new visitor shows up? Thanks in advance! ...

PHP parse directory and subdirectories for file paths and names of only jpg image types

I am looking to modify this php code to do a recursive "search for and display image" on a single, known, directory with an unknown amount of sub-directories. Here's the code I have that scans a single directory and echoes the files out to html: <?php foreach(glob('./img/*.jpg') as $filename) { echo '<img src="'.$fil...

Does anyone have a WORKING example that displays a directory tree structure in a TreeView for VB .NET??

I have looked everywhere and cannot find a version that works. The ones I found are all either outdated or have errors. I have something that is working for the most part, but I'm having some trouble with restricted-access folders. The code I'm using is as follows: Imports System.IO Public Class frmMain Private Sub frmMain_Load(B...

Prevent Access to a directory using C#

I am trying to create a program similar to Folder Lock which prevents users from accessing a particular folder. I tried using DirectorySecurity class and AccessRules to change the AccessControl for folders. However, the settings which i assign can easily be changed by going to "Security Tab" and changing the permissions. Is there any ...

Search for text with php

How would I scan a directory for a specific line of text and list all matching files with php? Thanks. ...