copy

File.Move and File.Copy gives IOException Logon failure

老子叫甜甜 提交于 2019-12-07 09:44:39
问题 I'm writing an add-in for a fujitsu scanner in C#. Documents are scanned to a local directory, and I wanted to copy them to a pc on the network. I keep getting System.IO.IOException: Logon failure: unknown user name or bad password though. I tried copying them to a public directory (at least I think its public), and I still get the same result. Any ideas for stuff I could try? I don't think my code here is the issue, but here it is anyway. private bool moveTheFile(String source, String

JAVA Zero Copy的相关知识

喜你入骨 提交于 2019-12-07 09:41:50
介绍 java 的zero copy多在网络应用程序中使用。Java的libaries在linux和unix中支持zero copy,关键的api是java.nio.channel.FileChannel的transferTo(),transferFrom()方法。我们可以用这两个方法来把bytes直接从调用它的channel传输到另一个writable byte channel,中间不会使data经过应用程序,以便提高数据转移的效率。 许多web应用都会向用户提供大量的静态内容,这意味着有很多data从硬盘读出之后,会原封不动的通过socket传输给用户。这种操作看起来可能不会怎么消耗CPU,但是实际上它是低效的:kernal把数据从disk读出来,然后把它传输给user级的application,然后application再次把同样的内容再传回给处于kernal级的socket。这种场景下,application实际上只是作为一种低效的中间介质,用来把disk file的data传给socket。 data每次穿过user-kernel boundary,都会被copy,这会消耗cpu,并且占用RAM的带宽。幸运的是,你可以用一种叫做Zero-Copy的技术来去掉这些无谓的 copy。应用程序用zero copy来请求kernel直接把disk的data传输给socket

copy whole shared directory from network

為{幸葍}努か 提交于 2019-12-07 09:31:59
问题 I am trying to copy whole directory tree from server's shared folder to my local machine, I found Best way to copy the entire contents of a directory in C# post and decide to use that but as I guess DirectoryInfo doesn't support network shares, how can I change this code to work with network shares as a source? public static void CopyFilesRecursively(DirectoryInfo source, DirectoryInfo target) { foreach (DirectoryInfo dir in source.GetDirectories()) CopyFilesRecursively(dir, target

How to use PowerShell to download files from SharePoint?

眉间皱痕 提交于 2019-12-07 08:00:54
问题 I've used the following sites to help me get this far and to troubleshoot. Download file from SharePoint How to download newest file from SharePoint using PowerShell Mike Smith's Tech Training Notes SharePoint, PowerShell and .Net! Upload file to a SharePoint doc library via PowerShell Download latest file from SharePoint Document Library How to iterate each folders in each of the SharePoint websites using PowerShell PowerShell's Get-ChildItem on SharePoint Library I am trying to download

Copy permissions from one Windows Folder to another

只谈情不闲聊 提交于 2019-12-07 07:44:34
问题 I need to create a small C# Windows app which copies security permissions from one folder to another. That includes copying group permissions too. What would be the best way to approach such a challenge? Yosief Kesete 回答1: First get out the folder with DirectoryInfo then get out an instance of the DirectorySecurity class using the GetAccessControl method. Then you'll be able to call GetAccessRules and AddAccessRule which should hopefully get you started. 回答2: Rather than writing the whole

How to copy tab-delimited text to clipboard from within a unix shell while preserving the tabs?

ⅰ亾dé卋堺 提交于 2019-12-07 06:27:17
问题 I am trying to copy and paste a few lines of a file from within a UNIX environment into a webpage. I want to preserve the original formatting with disrupting the tabs. However, when I select a block of text and copy and paste it into a webpage, all of the tabs have been converted to various length runs of spaces. Can someone please tell me what I can do to preserve the original tabs? It needs to be as simple as possible so that newbie users can do the same! Thanks 回答1: Based on your comment

How can I copy an entire directory in Perl?

拜拜、爱过 提交于 2019-12-07 05:09:51
问题 I need to copy entire directory to some location. What is the best way to do so ? File::Copy copies only file by file as I saw it. By the way I work under Windows. Thanks for help. 回答1: Maybe look into File::Copy::Recursive. 回答2: A quick google search for "perl copy directory file::" finds File::Copy::Recursive Looks what you're after. 来源: https://stackoverflow.com/questions/1865883/how-can-i-copy-an-entire-directory-in-perl

How can I recursively copy the contents of directory using Perl?

99封情书 提交于 2019-12-07 04:56:08
问题 I am running the current version of ActivePerl on Windows Vista, and I was wondering if you could show me the best and simplest way to copy a folder and it's contents to another location. Contents would include various files, and most likely some more nested folders. I imagine there must be a module out there somewhere that I don't know about that does this - but if there is a simple homebrew type of solution I'd like to see that also. 回答1: Take a look at File::Copy::Recursive. 回答2: If you

MongoDB copy a field to another collection with a foreign key

岁酱吖の 提交于 2019-12-07 03:59:07
问题 I want to copy over the color from user collection to the Car collection. I'm using a foreign key which is userID. > db.test1.User.find() { "_id" : ObjectId("515f7db83f71d6bcb1c41a48"), "age" : 33, "Color" : "blue" } { "_id" : ObjectId("515f7dc03f71d6bcb1c41a49"), "age" : 52, "Color" : "red" } { "_id" : ObjectId("515f7dc43f71d6bcb1c41a4a"), "age" : 43, "Color" : "yellow" } > db.test2.Car.find() { "_id" : ObjectId("515f84883f71d6bcb1c41a54"), "speed" : 291, "userID" : ObjectId(

Copy std::map to std::set in c++

为君一笑 提交于 2019-12-07 03:38:32
问题 Is it possible with a STL algorithm to deep copy a std::map values to a std::set? I don't want to explicitly insert in the new set. I don't want to explicitly do this: std::map<int, double*> myMap; //filled with something std::set<double*> mySet; for (std::map<int, double*>::iterator iter = myMap.begin(); iter!=myMap.end(); ++iter) { mySet.insert(iter->second); } but find a more coincise and elegant way to do this, with a deep copy of values. 回答1: What about this? std::transform(myMap.begin()