file-copying

How do I get CopyFileEx to report back so I can cancel a file copy operation?

半世苍凉 提交于 2019-12-12 12:08:58
问题 I’m trying to use the FileUtilities.CopyFile wrapper for CopyFileEx from here . But the CopyFileCallbackAction doesn’t get called until after the file is copied (I’ve tried copying a large file). How do I get it to report back so I can cancel the copy if the user so wishes? EDIT: See Why is FileUtilities.CopyFile wrapper for CopyFileEx interfering with winforms? 回答1: The edit to my question (sending to Why is FileUtilities.CopyFile wrapper for CopyFileEx interfering with winforms?) sends to

Java : copy files efficiently with channel

五迷三道 提交于 2019-12-12 11:59:35
问题 I read one article regarding trasfer copy at https://www.ibm.com/developerworks/library/j-zerocopy/. which suggest to user channel for IO operation. There is a banchmark of copy file operation available at https://baptiste-wicht.com/posts/2010/08/file-copy-in-java-benchmark.html As per benchmark I can use either nio buffer or nio trasfer I also read FileChannel does buffereing in the OS level here How to implement a buffered / batched FileChannel in Java? Which is more efficient way to copy

Ansible text file busy error

若如初见. 提交于 2019-12-12 11:13:32
问题 I have a Vagrant / Ansible set up on my Windows host. Ansible is set up to run on the Ubuntu guest, as Vagrant up executes a shell script which copies the provisioning yml files onto the guest and installs Ansible also on the guest. The script runs the Ansible set up on the guest with the following command: # Ansible installations sudo apt-get install -y ansible # Copy all Ansible scripts to the ubuntu guest sudo cp -rf -v /vagrant/provisioning /home/vagrant/ # cp /vagrant/hosts /home/vagrant

Exclude folders in batch-copy-script

偶尔善良 提交于 2019-12-12 07:34:23
问题 I am using a batch file on a USB stick to backup my pictures. I use the following command: for /r C:\ %%x in (*.jpg *.png *.gif) do @copy /y %%x . I want to exclude files in the mailfolder WINDOWS and PROGRAM FILES. Does anyone have an idea how I can do this with a batch file? 回答1: Drop COPY and use ROBOCOPY which exists in Windows Vista+ & is downloadable for prior versions. It supports /XD to exclude specific directories & /XF to exclude file masks at the command line. E.g. robocopy.exe c:\

How to copy file from local system to other system in C# (windows app)?

早过忘川 提交于 2019-12-12 07:15:48
问题 I need to load help files from my windows C# application and move/copy to other system (to its local drive). Application (same C# windows application) on the local system will use it for help. What needs to be done to accomplish this? I understand File.Copy() but i don't know, will it hold for remote system also? 回答1: File.Copy( @"C:\localpath\file.hlp", @"\\remotemachinename\localpathonremotemachine\file.hlp"); Or something along those lines... the second value is a UNC path. And in case the

Files copied by my app not showing up on PC

陌路散爱 提交于 2019-12-12 02:37:49
问题 I'm trying to run a simple database backup in my application, but the files are not showing up when I connect the device to my PC, but appears to be OK in the Android File Manager. The file is being copied to "Downloads" folder by the way... Here is the code I'm running to copy it: //... private void backupDatabase(){ String downloadsPath = Environment .getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) .getAbsolutePath(); String backupDirectoryPath = downloadsPath+"/myapp

Application error on phone but not on emulator

别来无恙 提交于 2019-12-11 18:59:11
问题 ) I am beginner in Android programming and I have little problem. I wrote simple DataBase app(I have ready Data Base) and I need to copy it to app folder on phone. I have method for this. When I run app on emulator, all works but when I copy this app to my phone, app have crash. Can you help me? This is dbAdapter: import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import android.app.Application; import

Why does my treeview in GUI with QFileSystemModel sometimes freezing when I copying file in separate thread (Qt)?

做~自己de王妃 提交于 2019-12-11 16:12:12
问题 Here is my Model, that inherits QFileSystemModel class MyFileSysModel : public QFileSystemModel { Q_OBJECT public: MyFileSysModel( QObject *parent = 0); Qt::ItemFlags flags(const QModelIndex &index) const; bool dropMimeData(const QMimeData *data, Qt::DropActions supportedDropActions() const; }; in MainWindow I created model and initializied treeview MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); model = new MyFileSysModel(this);

FileCopy of NSIS installer not working in Windows 7 but working in Windows XP

天涯浪子 提交于 2019-12-11 15:24:54
问题 I am using FileCopy of NSIS installer to copy a folder along with its all subfiles from a source to destination. This works on XP but not on Windows 7. When i run the installer on Windows 7 , then the FileCopy dialog doesn't even appears, it is just skipped out. But in Windows XP, it properly shows the dialog box of "Copying Files" and succeeds. What's the problem? Please help. !define FileCopy `!insertmacro FileCopy` !macro FileCopy FilePath TargetDir CreateDirectory `${TargetDir}` CopyFiles

Why am I seeing IO Exception using File.Copy() that seems to come from reading a file?

雨燕双飞 提交于 2019-12-11 08:24:48
问题 Preface: I'm very new to coding and mostly self-taught. I'm writing a little app that will automatically copy my game save files to my backup directory. It uses the FileSystemWatcher class to watch a game's save directory and look for changes while I'm playing and calls OnChanged if a file is resized or written to. The problem I'm having is that when my program is copying a file, it sometimes crashes the GAME (in this case Terraria). I'm guessing this has something to do with access