- 論壇徽章:
- 0
|
兩臺機器A機sco unix,B機windows NT,兩臺機器不在同一局域網(wǎng)內(nèi),現(xiàn)從A機手工ftp到B機上get,put文件都沒問題。
但當我用C編程實現(xiàn)時就會出現(xiàn)程序在ftp_putfile這條命令處停下,也不報錯,put的文件在B機上只出現(xiàn)了文件名,而沒內(nèi)容。
- if (ftp_prconnect ( &ftpinfo, host ) < 0
- .......
- if (ftp_user( &ftpinfo, "username" ) < 0)
- .......
- if (ftp_passwd ( &ftpinfo, "passwd" ) < 0)
- .......
- if (ftp_putfile ( &ftpinfo, "test.c1", "test.c" ) < 0) {
- printf("error: ftp_putfile failed.\n");
- (void) check_n_close ( &ftpinfo, ABNORMAL );
- }
復(fù)制代碼
ftp_prconnect
ftp_user
ftp_passwd
這幾條命令都正常。
為什么手工ftp可以呢? 非常謝謝 |
|