rename
SFTP 또는 FTP 서버에서 파일 이름 바꾸기
설명
예제
파일 이름 바꾸기
FTP 서버에 연결하고 서버에 있는 파일 이름을 바꿉니다. 이 예제에서는 실제로는 존재하지 않는 컴퓨터인 ftp.example.com
에서 가상의 FTP 세션을 보여줍니다. FTP 서버에 파일을 업로드하고 변경할 수 있는 권한이 있는 FTP 서버 계정이 있을 경우, 이 예제에 나온 것처럼 rename
함수를 사용할 수 있습니다.
먼저, 서버에 연결합니다.
s = ftp('ftp.example.com')
FTP with properties: Host: "ftp.example.com" Username: "anonymous" Port: 21 ServerLocale: "en_GB" DirParserFcn: @matlab.io.ftp.parseDirListingForUnix Mode: "binary" LocalDataConnectionMethod: "passive" RemoteWorkingDirectory: "/"
FTP 서버에서 현재 폴더의 내용을 표시합니다.
dir(s)
myscript.m README.txt pub
FTP 서버에 있는 파일 이름을 바꿉니다.
rename(s,'README.txt','INTRO.txt')
이름이 바뀐 파일을 포함하여 FTP 서버의 업데이트된 내용을 표시합니다.
dir(s)
INTRO.txt myscript.m pub
입력 인수
s
— SFTP 또는 FTP 서버와의 연결
SFTP 객체 | FTP 객체
SFTP 또는 FTP 서버와의 연결로, SFTP 객체 또는 FTP 객체로 지정됩니다.
oldname
— 파일의 원래 이름
문자형 벡터 | string형 스칼라
SFTP 또는 FTP 서버에 있는 파일의 원래 이름으로, 문자형 벡터 또는 string형 스칼라로 지정됩니다.
newname
— 파일의 새 이름
문자형 벡터 | string형 스칼라
SFTP 또는 FTP 서버에 있는 파일의 새 이름으로, 문자형 벡터 또는 string형 스칼라로 지정됩니다.
팁
rename
함수는 SFTP 또는 FTP 서버에 있는 파일 이름만 바꿉니다. 로컬 컴퓨터에 있는 파일의 이름을 바꾸려면movefile
함수를 사용하십시오.
버전 내역
R2006a 이전에 개발됨
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)