copy

Recursively copying files with progress

时光怂恿深爱的人放手 提交于 2020-01-23 18:01:05
问题 I've seen questions asked here before about Python and copying files, but I have a different scenario to deal with. I'm almost done with a Linux distro installer I've been working on, and now all it needs to do is copy the files over to the destination partition. As most distro installers have a progress bar, I was hoping to add one too. Right now, I'm using PyQt4 and my code looks like this: self.status('Counting files...') self.count = int(check_output(['-c', 'find /opt/linux/work/root

keeping original Vector intact when modifying it's copy

荒凉一梦 提交于 2020-01-23 17:34:06
问题 I want to Copy a Vector containing the following struct and the importance for me is to keep the original Vector intact when i modify the copied one : public class objet_poid_n { public int Num; public double Poid; } supposing that we have : Vector original = new Vector(); original = filled((Vector) original); // function fills original with many objet_poid_n elements Vector destination = new Vector(); I tried : destination = original ; and destination = original.clone(); and destination

Fail Gradle Copy task if source directory not exist

纵饮孤独 提交于 2020-01-23 08:13:10
问题 I'm using Gradle to create a build script. I want to protect the script from wrong properties, one of the tasks in the script is simple Copy task and I notice that when I put non-exist directory as from parameter the task continue with Skipping task ':copySpecificPlatform' as it has no source files. Is there a way to cause the copy task to fail in this case? 回答1: You can try: task cp(type: Copy) { from 'empty' into 'target' inputs.sourceFiles.stopExecutionIfEmpty() } Every Task has its

Copy node and add value to attribute with Xslt

我的梦境 提交于 2020-01-23 08:00:08
问题 Basiccly i have problem with xml and xslt which i do not know how to solve, and would appreciate any help regarding this matter where to start. I have XML: <root> <test value="1" setting="3"> <tag1>data....</tag1> <tag2>data....</tag2> <tag n+1>data....</tag n+1> </test> <test value ... . . . </test> </root> Now i would now need to copy, all nodes in "test" node in this way and add always value 3 to settings value (settings value is changing in test node) in 4 new nodes like shown below so i

Copy node and add value to attribute with Xslt

╄→尐↘猪︶ㄣ 提交于 2020-01-23 07:59:29
问题 Basiccly i have problem with xml and xslt which i do not know how to solve, and would appreciate any help regarding this matter where to start. I have XML: <root> <test value="1" setting="3"> <tag1>data....</tag1> <tag2>data....</tag2> <tag n+1>data....</tag n+1> </test> <test value ... . . . </test> </root> Now i would now need to copy, all nodes in "test" node in this way and add always value 3 to settings value (settings value is changing in test node) in 4 new nodes like shown below so i

scala copy objects

大城市里の小女人 提交于 2020-01-23 04:44:31
问题 Is there a way to make a copy of an object (or even better a list of objects)? I'm talking about custom objects of classes that may be extended by other classes. example: class Foo() { var test = "test" } class Bar() extends Foo { var dummy = new CustomClass() } var b = new Bar() var bCopy = b.copy() // or something? 回答1: In Java, they tried to solve this problem a clone method, that works by invoking clone in all super-classes, but this is generally considered broken and best avoided, for

Faster way of copying data in Java?

馋奶兔 提交于 2020-01-22 10:07:05
问题 I have been given a task of copying data from a server. I am using BufferedInputStream and output stream to copy the data and I am doing it byte by byte. Even though it is running but It is taking ages to copy the data as some of them are in 100's MBs, so definitely it is not gonna work. Can anyone suggest me any alternate of Byte by Byte copy so that my code can copy file that are in few Hundred MBs. Buffer is 2048. Here is how my code look like: static void copyFiles(SmbFile[] files, String

Faster way of copying data in Java?

北慕城南 提交于 2020-01-22 10:06:07
问题 I have been given a task of copying data from a server. I am using BufferedInputStream and output stream to copy the data and I am doing it byte by byte. Even though it is running but It is taking ages to copy the data as some of them are in 100's MBs, so definitely it is not gonna work. Can anyone suggest me any alternate of Byte by Byte copy so that my code can copy file that are in few Hundred MBs. Buffer is 2048. Here is how my code look like: static void copyFiles(SmbFile[] files, String

Windows batch copy files from subfolders to one folder

ぃ、小莉子 提交于 2020-01-22 09:01:26
问题 I had tried to make batch script that copies all *.tif files located in D:\images(random named subfolders here) to d:\all. xcopy D:\Downloads\*.TIF D:\temp\ /s works, but it copies with all folder tree. I tried to use other keys, but its dont works. Thanks for help! 回答1: FOR is your friend. Read HELP FOR on the /R option and the %~nx variable substitution; and then try this very simple code. pushd d:\downloads for /r %%a in (*.tif) do ( echo COPY "%%a" "d:\temp\%%~nxa" ) popd watch carefully

Copying MySQL Database to another machine

拜拜、爱过 提交于 2020-01-21 20:08:39
问题 I have a MySQL Database on mt Windows computer. I need to take one database and copy it to another machine. The other machine also runs windows and has MySQL Database. The two machines cannot be connected through internet. What shall I do? How can that be done through USB-card? 回答1: Make a export DB Mysqldump in a sql file and copy the sql file to USB card and import it into the other machine.Follow the steps it would help you to achieve it To make mysql dump for reference see here Sample: