move all files and folders within a directory in matlab - matlab

I'm trying to move all files and folders within a directory to another location. I thought
movefile('D:\path\to\source\*', 'D:\destination\folder')
would work, but this gives me an error
Error using movefile
The requested lookup key was not found in any active activation context.

Related

does ROBOCOPY have any command options to create source folder if not exist

For example, if source folder is c:\abc\file1 which doesnot exist..it should create the folder in source rather than throwing this error
ERROR 2 (0x00000002) Accessing Source Directory cc:\abc\file1
The system cannot find the file specified.

Azure Data Factory SFTP Source Please check if the path exists. If the path you configured does not start

Hi I'm getting the following error....
GET METADATA works fine if I do WildCard like ASN to find list of files when I do for loop and pass each file name in the COPY Activity (Source)
ErrorCode=SftpPathNotFound,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Can't find SFTP path '/Receive/INX_XXXXXXXX_ASN_20210728012200817116546932367669276.xml'. Please check if the path exists. If the path you configured does not start with '/', note it is a relative path under the given user's default folder ''.,Source=Microsoft.DataTransfer.ClientLibrary.SftpConnector,''Type=Renci.SshNet.Common.SftpPathNotFoundException,Message=/opt/apps/uprd1bpn1/bpfs2/2021/July/0209/04/22/25565817aec33de9cnode2_WF128489406.dat (No such file or directory),Source=Renci.SshNet,'
Any ideas?
I was facing the same issue described above, the only difference was the type of my source file, .txt.
In my case the error message was misleading, the actual error message was getting hidden by the 'chunking' option. If you pay attention to the source tab of the copy activity, by default it is set to use 'chunking', which transfers your data at an increased speed.
By disabling chunking, I could notice the error was actually in a particular line of the file, then fixing the file, fixed the problem.
1. Check if "Copy behavior" on the sink side is marked as "None".
2. Check if you have permissions for uploading the files.
3. For wildcardFileName Dynamic content of fileName should be replaced with asterisk (*).
E.g. If 20210728012200817116546932367669276 is dynamic content in your filename
then wildcardFileName for INX_XXXXXXXX_ASN_20210728012200817116546932367669276.xml should be INX_XXXXXXXX_ASN_*.xml
Refer - SFTP as sink - getting can't find SFTP path error

.gitignore all except one specific file (via a full/fuller file path)

The Goal:
How to use .gitignore to exclude all folders & files except PowerShell $Profile?
The answer should help expand the current exception file list to more files in other subfolders. If possible, reduce wildcards to minimum, and use as specific as possible (full/fuller file path). Why? For instance, Book1.xlsx may exist in multiple subfolders but I want to be able to choose only the specific desired subfolders.
Thanks in advance!
Current status:
On Windows 10 (not Linux Distros):
git init initiated on top level directory C:\. [Please don't suggest to start from other subfolders. Just remain with C:\, as I will include more files to the exception list]
C:\.gitignore containing the below:
# Ignore All
/*
# Exception List [eg. PowerShell's $Profile (please use FULL/FULLER FILE PATH, if possible)]
!.gitignore
!Microsoft.PowerShell_profile.ps1
!Users/John/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1
!Users\John\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
!C:/Users/John/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1
!C:\Users\John\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
With the above codes, git status successfully returned only .gitignore as 1 untracked file. Microsoft.PowerShell_profile.ps1 remained missing from untrack listing.
I've tried alternative ways (wildcard, partial subfolder name with pattern, etc) but all failed to return the fuller file path PowerShell $Profile.

How to put files with Talend respecting directory structures

I'm trying to ftp files from a directory containing subdirectories and I'd like the directory structure/hierarchy to be respected on the server.
The job looks like this :
With the various components set like this :
and I've got a NullPointer Exception when accessing the row1.localPath variable (even if when tLogRow I see the right information I need).
You could link the tFileList directly to the tFTPPut component(iterate link), using tFileList_1_CURRENT_FILEPATH as the local directory in tFTPPut.

Robocopy file to random named folder

I'm creating a script to automatically copy and paste bookmarks to x amount of computers.
Robocopy the Mozilla Bookmarks which are stored in a file called places.sqlite on a drive. To the destination
Appdata\Roaming\Mozilla\Firefox\Profiles\\*RANDOM PROFILE NAME\places.sqlite
I can't find a solution to copy this file to the destination due to every windows profile and computer gets a random profile name created. I tried with a star * as you can see in the code because I thought a star choices the newest folder (last changed).
The code is:
$env:homeshare
$env:username
Robocopy "$env:homeshare\ComputerChange\" "C:\Users\$env:username\AppData\Roaming\Mozilla\Firefox\Profiles\*\" "places.sqlite" /COPY:DAT
How do I edit the code so it chooses the random named folder? Is it possible to copy the places.sqlite to ALL folder in the Profiles\ folder?
Appreciate the help