copy

Append date to filename before copy in php

落爺英雄遲暮 提交于 2019-12-05 19:22:46
I am trying to append date to the file name before copying in PHP. $fileS = "file.csv"; $date = date('m-d-Y H:i:s A e'); $fileD = "file$date.csv"; I have even tried $fileD = "file"."date('m-d-Y H:i:s A e')".".csv"; Then I copy the files $Confirm = copy($fileS, $fileD); I know I should check if the file exists etc etc but for the sake of simplicity to ask the question I am using this :). I am assuming it's something to do with the copy function that doesn't read concatenated strings. I may be wrong here. Any help with this is great appreciated. EDIT: The colon seems to be the problem not the

How to modify a value in one “cell” of a pandas data frame?

本小妞迷上赌 提交于 2019-12-05 18:57:13
I have a very simple problem. I would like to change a value in a given column of a given row of a pandas data frame. I try to do it in the following way: df['column3'].loc[this_date] = val As a result I get the following warning: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame My interpretation of this warning is that by using columns name ( 'column3' ) and loc I do not really access (refer to) the desired cell of the data frame. Instead, I create an object which is a copy of the "cell" object and then I try to change the value associated with this

How do I copy files using Windows Batch?

∥☆過路亽.° 提交于 2019-12-05 17:47:03
I have a directory with several subdirectories with files. How can I copy all files in the subdirectories to a new location? Edit: I do not want to copy the directories, just the files... As this is still on XP, I chose the below solution: for /D %S IN ("src\*.*") DO @COPY "%S\" "dest\" Thanks! Ok. With your edit that says you don't want the directory structure, i think you're going to want to use something like this: for /F "usebackq" %s IN (`DIR /B /S /A-D SrcDir`) DO @( XCOPY %s DestDir\%~nxs ) The Xcopy command should help here. XCOPY /E SrcDir\*.* DestDir\ Or if you don't want any of the

File.Move and File.Copy gives IOException Logon failure

人盡茶涼 提交于 2019-12-05 17:36:53
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 destination) { System.DirectoryServices.DirectoryEntry dntry = null; try { //System.IO.File.Move(source,

Is there a back_inserter variant that takes advantage of move?

南楼画角 提交于 2019-12-05 16:34:24
In generic code I was trying to tell an output iterator (in practice a std::back_inserter_iterator to move a range of elements. To my surprise it looked as if elements were moved in a move-to-back_inserter operation. #include<algorithm> // move #include<iterator> // back_inserter #include<vector> int main(){ std::vector<std::vector<double> > v(10, std::vector<double>(100)); std::vector<std::vector<double> > w; assert( not v[0].empty() and w.size() == 0 ); std::copy(v.begin(), v.end(), std::back_inserter(w)); assert( not v[0].empty() and w.size() == 10 ); std::move(v.begin(), v.end(), std::back

How to use PowerShell to download files from SharePoint?

被刻印的时光 ゝ 提交于 2019-12-05 16:30:21
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 random files from SharePoint folder, and I have it working for when I actually know the file name and

The “trait Clone is is not implemented” when deriving the trait Copy for Enum

霸气de小男生 提交于 2019-12-05 15:26:23
问题 The following code: #[derive(Copy)] enum MyEnum { Test } Is giving me this error: error: the trait core::clone::Clone is not implemented for the type MyEnum [E0277] Why is that the case, and how do I fix it? 回答1: The Copy trait is a subtrait of Clone, so you always need to implement Clone if you implement Copy : #[derive(Copy, Clone)] enum MyEnum { Test } This makes sense, as both Copy and Clone are ways of duplicating an existing object, but with different semantics. Copy can duplicate an

Detecting whether a file is complete or partial in PHP

本秂侑毒 提交于 2019-12-05 14:57:38
问题 In this system, SFTP will be used to upload large video files to a specific directory on the server. I am writing a PHP script that will be used to copy completely uploaded files to another directory. My question is, what is a good way to tell if a file is completely uploaded or not? I considered taking note of the file size, sleeping the script for a few seconds, reading the size again, and comparing the two numbers. But this seems very kludgy. 回答1: In theory, in case you are allowed to run

Copy node and add value to attribute with Xslt

不问归期 提交于 2019-12-05 14:23:57
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 would get: <root> <test value="2" setting="6"> <ni1 name="1" setting1="6">data....</ni1> <ni2 name="1"

using Visual Studio to copy files?

依然范特西╮ 提交于 2019-12-05 13:10:23
问题 I want to create a Visual Studio (I am using VSTS 2008) project which simply does file copy work, in more details, I will add some files to this project and this project copy files (included in this project) to some destination location when I build the project. Any ideas how to do this in VSTS? BTW: I heard using proj file could do such kinds of task, but I have not found any good simple to learn samples for beginner. :-) thanks in advance, George 回答1: You can add a post build step in Visual