using copyfile to copy the FOLDER AND its CONTENTS, i.e., preserve the folder

조회 수: 9 (최근 30일)
HC98
HC98 2023년 5월 26일
답변: Hiro Yoshino 2023년 5월 26일
In linux one cna use rsync to copy the folder with its contents inside to another diretory. unfortucately, when I use copyfile, it copies the files within the folder but does not copy the folder containing them. I want to transfer the folder as a whole unit.

답변 (1개)

Hiro Yoshino
Hiro Yoshino 2023년 5월 26일
Why don't you use system command instead?
You can use the linux commands as you wish.
system("touch myFile.txt") % create myFile.txt file here
ans = 0
[stts, cmdout] = system("ls -s") % list the current working directory
stts = 0
cmdout =
'total 0 0 myFile.txt '

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by