directory

Git putting folders in folders - In a repository

那年仲夏 提交于 2019-12-11 11:08:04
问题 So, I'm pretty new to the whole GitHub thing. Consequently my repo looks like a messy pile of shit. Anyway, I wanted to put in a little effort to clear it up, so I pulled it down, updated the folder system to how I wanted it, and pushed it back up. Anyway, the new folders are showing there with the sub-folders inside. However, the sub-folders are still showing in my repository. I would rather they were in these folders so I can keep it a bit better organised. Is there anyway to do this and

Why am I getting a 0x8000500c error when enumerating a SearchResultCollection in .Net

孤者浪人 提交于 2019-12-11 11:07:57
问题 I am trying to enumerate the values in a SearchResultCollection. Everything compiles fine, but I get the 0x8000500c error on this line: foreach (PropertyValueCollection e in de.Properties.Values) { sw.WriteLine(e.Value); } Full method is below: private static void GetValues() { var directoryEntry = new DirectoryEntry("LDAP://8.8.8.8:8888", "foo", "bar", AuthenticationTypes.None); var ds = new DirectorySearcher(directoryEntry); var final = ds.FindAll(); var sw = new StreamWriter(@"C:\z\FooBar

'find' (command) finds nothing with -wholename

邮差的信 提交于 2019-12-11 10:54:44
问题 Why does this command work: /home/user1/tmp $ find ./../.. -wholename '.*/tmp/file.c' -exec echo '{}' \; ./../../user2/tmp/file.c /home/user1/tmp $ And this command does not work? (finds nothing) /home/user1/tmp $ find /home -wholename '.*/tmp/file.c' -exec echo '{}' \; /home/user1/tmp $ 回答1: The first command generates file names starting with ./../.. . Thus the wholename pattern will match because they start with . . The second command generates filenames starting with /home . However, the

Make Directory Part Dynamic In Call To BFILENAME function In Oracle 10g

一曲冷凌霜 提交于 2019-12-11 10:49:44
问题 I am trying to open an existing physical file from file system in a procedure in Oracle 10g. The bfilename function requires a directory and path. I want to pass on the directory such as "c:\abc" directly to the procedure, i.e. I don't want to pass a directory object. The reason is, the directory can change, and I don't know how to create or replace directory inside a procedure (the command always returns error saying that variable is not allowed). I also am not sure about how it works in a

Creating XML file representing folder structure (including subfolders) in C#

假如想象 提交于 2019-12-11 10:43:16
问题 How can produce an XML file structuring a given folder to recursively represent all the files & subfolders within it? 回答1: That's great example of problem, that can be easily solved using recursive algorithm! Pseudo-code: function GetDirectoryXml(path) xml := "<dir name='" + path + "'>" dirInfo := GetDirectoryInfo(path) for each file in dirInfo.Files xml += "<file name='" + file.Name + "' />" end for for each subDir in dirInfo.Directories xml += GetDirectoryXml(subDir.Path) end for xml += "<

How to remove files from a directory if they don't contain the list of specified files provided?

你。 提交于 2019-12-11 10:30:01
问题 I'm currently doing a project where I need to search through a specific directory for files. If the files found are not the approved extension then the files must be moved to an archive folder. I need to user to be allowed to remove and add extensions so the list is not a set size and will most likely change weekly. So far I'm able to loop through the directories and list all the files in there into a listbox. My problem comes when trying to differentiate between the approved list and the

Perl Readline on closed filehandle - file does not exist error

天大地大妈咪最大 提交于 2019-12-11 10:29:53
问题 I am working on a simple perl program for my first assignment in my programming class. I literally have been stuck on this first part for more than a day. I cannot get my program to simply open a text file that is in the same directory as the program. #!/usr/bin/perl -w use strict; my($fileName, $line); print "Please enter name of file to be opened: ", "\n"; $fileName = <STDIN>; chop($fileName); #Associates FILE filehandle with the file: "filename.txt" open(FILE, $fileName) or die("Can't open

Batch file to rename files in multiple folders

纵然是瞬间 提交于 2019-12-11 10:11:20
问题 I have the folder and file structure as given below. I am in need of a MS DOS batch file to rename the files in multiple folders. Can anyone please help out? TIA. -Main Folder -->Sub Folder1 --- File1_EN.txt --- File2_EN.txt --> Sub Folder2 --- File3_EN.txt --- File4_EN.txt I want to rename the suffix "EN" in file names to "ENU". 回答1: @echo off for /D %%d in (*) do ( ren "%%d\File*_EN.txt" "File*_ENU.txt" ) 回答2: You can do it by this way: @Echo OFF Set "Folder=C:\Users\Administrador\Desktop

Sendgrid/PHP/Heroku Not Working

。_饼干妹妹 提交于 2019-12-11 09:54:49
问题 I added the basic version of SendGrid to Heroku so we could send user-feedback emails from our website. The basic testing implementation I'm using is below: <?php /**** Takes posted content from 'contact.html' and sends us an email *****/ require 'sendgrid-php/SendGrid_loader.php'; $sendgrid = new SendGrid('username', 'pwd'); $mail = new SendGrid\Mail(); $mail-> addTo('matthewpolega@gmail.com')-> setFrom('matthewpolega@gmail.com')-> setSubject('another')-> setText('Hello World!')-> setHtml('

how to check if given path is pointing to existing file OR directory?

ε祈祈猫儿з 提交于 2019-12-11 09:47:00
问题 I need a function that simply returns bool if there is an entity at the given path, no matter if file or directory. What function to use either in winapi or stl ? 回答1: GetFileAttributes() will return information about a file system object which can be queried to determine if it is a file or directory and it will fail with if it does not exist. For example: #include <windows.h> #include <iostream> int main(int argc, char* argv[]) { if (2 == argc) { const DWORD attributes = GetFileAttributes