directory

NetServerEnum: List of servers on domain while on workgroup

Hi. I am logged in to a workgroup MSHOME and need to access a named list of server pc's on a domain "xxx.local". I have tried this: const int MAX_PREFERRED_LENGTH = -1; int SV_TYPE_WORKSTATION = 1; int SV_TYPE_SERVER = 2; IntPtr buffer = IntPtr.Zero; IntPtr tmpBuffer = IntPtr.Zero; int e...

Folder to dump windows service log files

Short: What's the most appropriate folder for windows service to dump log files into? Details I have a windows service that produces log files that a low-tech end user might be interested to look at (actual communication between a computer and a manufacturing line monitoring sensors). The computer is a stand-alone dedicated computer...

output files from a second directory in same php function

I have the following code to output images from directory im/, how can I tweak this to also output images from another diectory called out/ (for example)? As to echo another img tag under the current one? <?php $imgDir = "im/"; $images = scandir($imgDir); $ignore = array( ".", ".." ); natsort($images); foreac...

How do I set the working directory of the parent process?

Programming environment assumed: Linux, GCC As the title reveals it, we are writing a Unix-style shell utility U that is supposed to be invoked (in most cases) from bash. How exactly could U change the working directory of bash (or parent in general)? P.S. the shell utility chdir succeeds in doing exactly the same, thus there must be ...

Question: Using Windows 7, Unauthorized Access Exception when running my application

My application is raising an unauthorized access error. While running my application, I try to access a directory in the following location: Application.UserAppDataPath. The Problem: It says I do not have permission to access the Application.UserAppDataPath directory Is there a way to set permissions within my application source code? ...

How do I scan a folder in Java?

I need to scan a particular folder in Java, and be able to return the integer number of files of a particular type (based on not only extension but also naming convention.) For example, I want to know how many JPG files there are in the \src folder that have a simple integer filename (say, 1.JPG through 30.JPG). Can anyone point me in th...

C++ - Load all filename + count the number of files in a current directory + filter file extension

I want to count the number of file in the current directory as well as load all file names in the array. If possible, I want to know how to filter file extension also ...

NGINX : Allow users to password protect directories themselves?

To my knowledge Nginx can only password protect directories from within the configuration file(s). That works nicely, but is not a real option for end-users who A) can not edit the configs and B) would break the configs if they could Right now I am thinking about a webbased representation of the directory structure where they can point ...

PHP recursive directory path

i have this function to return the full directory tree: function getDirectory( $path = '.', $level = 0 ){ $ignore = array( 'cgi-bin', '.', '..' ); // Directories to ignore when listing output. Many hosts // will deny PHP access to the cgi-bin. $dh = @opendir( $path ); // Open the directory to the handle $dh while( false !== ( $file =...

Creating Directory on Server in ASP.NEt programatically

Hi, I want to programatically create a directory on the server using ASP.NET. I have done this using System.IO's Directory.CreateDirctory. however, the newly created folder is not accessible in the code. after searching a bit, I came to know that the newly create folder is not included the project and hence not accessible. Can any...

How can I find a package?

In my code I have the following statement import com.apple.dnssd.*; and compiler (javac) complains about this line. It writes that the package does not exist. But I think that it could be that "javac" search the package in a wrong place (directory). In this respect I have two questions: How can I know where javac search for the package...

Recursively ZIP a directory containing any number of files and subdirectories in Java?

Is there an easy way to recursively ZIP a directory that may or may not contain any number of files and any number of levels of subdirectories? ...

IIS Directory Browing

Hi All, If I enable directory browsing in IIS it displays folder contents to user. Is there any way of controlling the way it shows the list. For example, I dont want to show full physical path of the folder. Is it possible to achieve? If yes, how? Thanks. ...

cd option in bash script

I'm a complete newbie to bash scripting. I remember there was a way to execute the cd command, automatically returning to the current directory (without an explicit cd ..). Any idea? ...

how can i send the listview files to the directory using c#.net?

i have the files situated in the listview now i want to copy those files to a directory in windows.. how this action can be performed?? ...

Average and maximum size of directories

I have a directory and a bunch of sub-directories like this: - directory1 (sub-dir1, sub-dir2, sub-dir3, sub-dir4, sub-dir5...........and so on, hundreds of them...) How do I find out what is average size of the sub-directories? And how do I find what is the maximum size of the sub-directories? All using Unix commands... Thanks. ...

How to pull specific directory with git

hello, I have a project with git, and I just want to clone or pull a specific directory, like myproject/javascript just like subversion does. make some changes, commit and push back again. It's possible? ...

Can I change the default directory on my local drive for all Git activity?

So I just started using Git and GitHub. It's still a steep climb, but I'm starting to enjoy it. One thing I've noticed from when I clone a repository is that it always downloads to my home folder /users/username. Is there a way to change this? I went searching through the Git manual and thought I might be able to use --git-dir=GIT_DIR, ...

WiX/Windows Installer: Re-install to a new folder

1. I am using WiX for creating installer and would like to implement the following behaviour: If a user launches msi installer for the product and the product already installed, then wizard works similar to pure (first time) installation with exception of some things (e.g. license aggrement screen is omitted). The wizard should allow for...

Check whether a folder is a local or a network resource in .NET

Is there a quick way to check whether a path I have is on a local disk or somewhere on the network? I can't just check to see if it's a drive letter vs. UNC, because that would incorrectly identify mapped drives as local. I assumed it would be a boolean in the DirectoryInfo object, but it appears that it's not. I've found classic VB cod...