directory

PHP File Navigation (Local + Remote)

I have been working on a content management system (nakid) and one of my toughest challenges is the file navigation. I want to make sure the file paths and settings work on local and remote servers. Right now my setup is pretty much something like this: first.php (used by all pages): //Set paths to nakid root $core['dir_cur'] = dirname...

How to get SVN directory size using sharpsvn?

i am reading svn contents using GetList method of svnClient class, i want to know how can i determine the full size of directory including sub directories, i can read the size using FileSize property of SvnListEventArgs. ...

Set HTTP header for all PHP scripts via .htaccess file

Hi to all gurus, I code same lines all PHP programs at one of my projects. Is it possible to do this at .htaccess for a directory? And how? PHP codes: Header('Content-Type: application/xhtml+xml; charset=utf-8'); Header("Cache-Control: no-transform"); Thanks any help. Best regards. Yusuf Akyol ...

Path.Combine and the dot notation

I'm looking for something akin to Path.Combine method that will help me correctly combine absolute and relative paths. For example, I want Path.Combine(@"c:\alpha\beta", @"..\gamma"); to yield c:\alpha\gamma instead of c:\alpha\..\gamma as Path.Combine does. Is there any easy way of accomplishing this? Needless to say, I also want to ...

PHP DirectoryIterator help

In the following code, what can be called instead of ->getFilename()? <?php foreach (new DirectoryIterator('../moodle') as $fileInfo) { if($fileInfo->isDot()) continue; echo $fileInfo->getFilename() . "<br>\n"; } ?> PS, I have seen the documentation. Please don't link to here. Thanks for the help. EDIT: After posting thi...

how to display files inside directory

i am trying to get list of files inside the directory in this case "c:\dir\" (ofcourse i have files inside) and i wanted to display the name of those files in console program build in c#.... initially i did this.... static class Program { static void Main() { string[] filePaths = Directory.GetFiles(@"c:...

How to change icon/emblem of a directory from bash

I'm playing around with get_iplayer (fantastic) it's running every few hours to grab any new episodes of whatever.... After it has finished grabbing anything new i'd like to change the emblem of ~/Videos to add a plus or star (nautilus emblem preferably) Do i go about this via nautilus? Do i need to change something in gnome-config? I'...

How do I create a Unicode directory on Windows using Perl?

I struggle to create directory names containing Unicode. I am on Windows XP and Perl Camelbox 5.10.0. Up until now I used to use File::Path qw ( make_path ) to create directories - which worked fine until the first cyrillic directory appeared. For files Win32API::File qw ( CreateFileW ) works fine if the file name is UTF-16LE encoded. ...

Difference Between getcwd() and dirname(__FILE__) ? Which should I use?

In PHP what is the difference between getcwd() dirname(__FILE__) They both return the same result when I echo from CLI echo getcwd()."\n"; echo dirname(__FILE__)."\n"; Returns: /home/user/Desktop/testing/ /home/user/Desktop/testing/ Which is the best one to use? Does it matter? What to the more advanced PHP developers prefer? ...

How to make SVN ADD ignore binaries

Binaries (under Linux) don't have an extension so I cannot exclude them using patterns. Thus when I use SVN add to add a directory I will get something like $ svn add recursion_vector/ A recursion_vector A recursion_vector/rec_vec.cxx A recursion_vector/rec_vec.h A (bin) recursion_vector/rec_vec Here rec_vec ...

How do I check if a Unicode directory exists on Windows in Perl?

I need to check whether a Unicode directory exists in Perl. I am using Windows XP and Perl Camelbox 5.10.0. If I try to create a directory (like Sinan suggested here stackoverflow.com/questions/2184726) that already exists the program dies. Unfortunately if ( !-d $dir_name ) { # create directory $dir_name } doesn't seem to recognize Un...

Working folder in ASP.NET

We have a web application written in ASP.NET 3.5. In it, we access a file in the code-behind. (Ordinary C# file access, done on the server during the page life-cycle, this has nothing to do with URLs or web browsers). On our production systems, we specify the full path to the file in question in the web.config. We'd like to be able t...

PHP delete the contents of a directory

Hello, How do I do that? Is there any method provided by kohana 3? ...

Can a Ruby script tell what directory it’s in?

Hello, everyone! Inspired by this question, what's the Ruby way to do this? ...

What's the most simple way to get files only visible in Finder in a directory?

NSFileManager has several method to enumerate directory contents, but they returns all files including hidden or system files which is invisible for users in Finder. I want to get the file list same as Finder. As possible as simple. What do I have to do? ...

URL Encoding with Underscores in a Directory Name?

We've run into an odd argument where I work, and I may be wrong on this, so this is why I am asking. Our software outputs a directory to an Apache server that replaces an underscore with a %5F in the name of the directory. For instance if the name of the directory was listed as a string in our software it would be: "andy_test", but t...

C# delete a folder and all files and folders within that folder

Hi all, I'm trying to delete a folder and all files and folders within that folder, I'm using the code below and I get the eror "Folder is not empty", any suggestions on what I can do? Thanks try { var dir = new DirectoryInfo(@FolderPath); dir.Attributes = dir.Attributes & ~FileAttributes.ReadOnly; dir.Delete(); dataGridView1.Row...

C# deleting a folder that has long paths

Hi all, I'm trying to delete a folder and the delete is failing due to the folder containing long paths. I presume I need to use something else instead of dir.Delete(true), Anyone crossed this bridge before? Many thanks try { var dir = new DirectoryInfo(@FolderPath); dir.Attributes = dir.Attributes & ~FileAttributes.ReadOnly; dir....

Directory.CreateDirectory Latency Issue?

I'm trying to create a remote directory, and then write a file to it. Every great once in a while, the application fails with a System.IO.DirectoryNotFoundException while trying to write the file. When I write the file, I'm using the returned DirectoryInfo object to help create the file path, so the application seems to think that the d...

Capistrano install directory problem

I'm doing my first Rails deployment and using capistrano, following my host's directions: I have the domain plantality.com. I've created the gws folder for my app. I've installed with capistrano and followed all the wiki instructions I could find. public_html is pointing to gws/public but capistano has installed my app to gws/current...