⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tcpip_sendfile.m

📁 A very small 250-line library (written entirely in MATLAB) that allows multiple MATLAB programs to t
💻 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 + -