Topic "Transferring Empty Text Files"

Author Message
Guest

Guest


Hi,

I wrote a WinSCP Script to transfer files over. But seems like empty .txt files are ignored for transfers. Is there any way to enable empty .txt files for transfer too?

Here is an example of my script:

Code:
option batch off
option confirm off
option transfer binary
 
open sftp://username:password@server:22

put D:\folder_name\*.txt
 
close
exit


Thanks in advance for the reply.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24556
Location: Prague, Czechia
They should not. Can you post a log file showing unsuccessful upload of single empty file?
_________________
Martin Prikryl
Guest

Guest


Hi,

Apologies on the late reply.

I am unsure on how to log the transfer. However, I have entered the exact comamnds in the previous email in console and these are the output I get in the console. Hope it helps.

winscp> put D:\folder_name\*.txt
D:\folder_name\empty1.txt | 0 kB | 0.0 kB/s | binary | 0%
D:\folder_name\empty2.txt | 0 kB | 0.0 kB/s | binary | 0%
D:\folder_name\empty3.txt | 0 kB | 0.0 kB/s | binary | 0%
winscp>


I do not think that the transfer failed though. Seems like it was 'skipped'. Does the server settings have anything to do with this? Thank you once more for your help!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24556
Location: Prague, Czechia
Can you try the same in GUI? Also what version of WinSCP are you using? Can you try the latest one?
Guest

Guest


Hi,

Sorry for the late reply.

I am currently using WinSCP 4.0.5.

I have actually tried transferring the files to other different servers (using FTP though) and it seems to have successfully transferred the files over even though it is an empty .txt file.

When I tried with another server, it seems to have "skipped" transferring these empty files over for both FTP and SFTP.

Hope you can help me out here. Thanks a lot!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24556
Location: Prague, Czechia
OK, but again does it work in GUI or not?
_________________
Martin Prikryl
ToKi
[View user's profile]

Joined: 2009-03-03
Posts: 2
Location: Sydney
prikryl wrote:
OK, but again does it work in GUI or not?

I have the same problem.
The file can be transfered through the gui but when in command line mode the 0kb file doesn't get sent. Usually you get 100% on the transfer file line but with 0kb files it stays at 0%. I had a look at the log and there were no failures.
I have tried sending in both Ascii and Binary modes with the same result.

. 2009-02-23 17:35:13.264 Copying 1 files/directories to remote directory "/Toxxx"
. 2009-02-23 17:35:13.264 PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 01; Resume: S (102400); CalcS: No; Mask:
. 2009-02-23 17:35:13.264 TM: M; ClAr: No; CPS: 0; ExclM(No):
. 2009-02-23 17:35:13.264 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2009-02-23 17:35:13.264 File: "L:\xxxxgan\20090223_RExx_APAC_xxx.txt"
. 2009-02-23 17:35:13.264 Copying "L:\xxxxgan\20090223_RExx_APAC_xxx.txt" to remote directory started.
. 2009-02-23 17:35:13.264 Ascii transfer mode selected.
. 2009-02-23 17:35:13.264 Opening remote file.
> 2009-02-23 17:35:13.264 Type: SSH_FXP_OPEN, Size: 60, Number: 259
< 2009-02-23 17:35:13.717 Type: SSH_FXP_HANDLE, Size: 10, Number: 259
> 2009-02-23 17:35:13.717 Type: SSH_FXP_CLOSE, Size: 10, Number: 772
> 2009-02-23 17:35:13.717 Type: SSH_FXP_SETSTAT, Size: 56, Number: 521
< 2009-02-23 17:35:14.514 Type: SSH_FXP_STATUS, Size: 40, Number: 772
< 2009-02-23 17:35:14.514 Status/error code: 0
< 2009-02-23 17:35:14.967 Type: SSH_FXP_STATUS, Size: 40, Number: 521
< 2009-02-23 17:35:14.967 Status/error code: 0
. 2009-02-23 17:35:14.967 Closing connection.
. 2009-02-23 17:35:14.967 Sending special code: 12
. 2009-02-23 17:35:14.967 Sent EOF message
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24556
Location: Prague, Czechia
ToKi wrote:
The file can be transfered through the gui but when in command line mode the 0kb file doesn't get sent. Usually you get 100% on the transfer file line but with 0kb files it stays at 0%. I had a look at the log and there were no failures.
I have tried sending in both Ascii and Binary modes with the same result.

Are you sure that the file wasn't actually created? Despite 0% indication in script output?
_________________
Martin Prikryl
ToKi
[View user's profile]

Joined: 2009-03-03
Posts: 2
Location: Sydney
I changed the way the script runs. I will check the results tomorrow.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License