File節(jié)點(diǎn)是操作文件的節(jié)點(diǎn)
為開化等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計(jì)制作服務(wù),及開化網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為做網(wǎng)站、網(wǎng)站制作、開化網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!file文件的保存
拖拽 注入節(jié)點(diǎn)inject file節(jié)點(diǎn)(writes msg.payload to a file)和 debug節(jié)點(diǎn)到工作區(qū),并連線
設(shè)置file節(jié)點(diǎn)的文件路徑
windows如果不設(shè)置路徑,會(huì)保存在C:\Users\Administratordocker容器保存在根目錄下
此處文件名我選擇 放到data目錄下,因?yàn)閐ocker容器啟動(dòng)的時(shí)候我把/data目錄掛載到宿主機(jī)上了,方便查看文件
行為有三種,追加至文件 復(fù)寫文件 刪除文件
勾選上創(chuàng)建目錄,否則如果目錄和文件不存在,需要手動(dòng)創(chuàng)建
例子:
[{"id":"898828bc.89b418","type":"inject","z":"6c70a17b.e110f","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":290,"y":300,"wires":[["1e951d4f.b4d6a3"]]},{"id":"1e951d4f.b4d6a3","type":"file","z":"6c70a17b.e110f","name":"save","filename":"/data/testtimestamp.txt","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"none","x":450,"y":300,"wires":[["c27669f0.bef7e8"]]},{"id":"c27669f0.bef7e8","type":"debug","z":"6c70a17b.e110f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":610,"y":300,"wires":[]}]