[問題] 取檔案內容 再把內容當成檔名開檔
開發平台(Platform): LINUX
額外使用到的函數庫(Library Used): 無...
問題(Question):從一個檔案中把內容撈出來 當做檔名再開檔卻開檔失敗
餵入的資料(Input): /mnt/memcached/failover_ip
預期的正確結果(Expected Output):應該不會印出 open failed 訊息
錯誤結果(Wrong Output):
會印出
Line length:15
incre : 14
failover ip : 192.168.39.155
failover count : 15
/mnt/memcached/192.168.39.155_11211_exist
file length: 42
open failed
程式碼(Code): http://pastie.org/2172221
補充說明(Supplement):
如果將
sprintf(exits_file,"/mnt/memcached/%s_%s_exist",failover_client,client_tcp);
替換成
sprintf(exits_file,"/mnt/memcached/192.168.39.105_%s_exist",client_tcp);
就可以順利開檔
/mnt/memcached/failover_ip檔內容是 192.168.39.155
請各位懂的大大幫忙解一下 感恩Orz
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 58.115.19.89
※ 編輯: smallma009 來自: 58.115.19.89 (07/06 21:18)
→
07/06 21:25, , 1F
07/06 21:25, 1F
→
07/06 21:30, , 2F
07/06 21:30, 2F