📄 tcpip_sendfile.m
字号:
function ret=tcpip_sendfile(ip_fid,name) %% ret = tcpip_sendfile(ip_fid,name)%% ip_fid Number for tcpip channel.% name Name of file to send% ret Return value%% Send a file over network with tcpip.% Using a own protocol. se also tcpip_getfile% NL=char(10); %Define newline character fh=dir(name); fid=fopen(name,'rb'); if fid==-1, ret=-1; return; end dump=tcpip_write(ip_fid,NL,'==BINFILE==',NL,fh.name,NL,num2str(fh.bytes),NL,'DATA:'); buff=''; while feof(fid)==0, buff=[buff,char(fread(fid,100000))]; buff=tcpip_write(ip_fid,buff); end dump=tcpip_write(ip_fid,'==END==',NL); fclose(fid); return;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -