When 'Im trying to copy a file to ftpfs, first try failed, but create an empty file on ftpfs.
Second try overwrite the emty file.
curlftpfs v 0.9.2
curl v 7.18.2
ftp server does not support resume and is a pure-ftpd
Command exemple:
$ cp curlftpfs-0.9.2-1.fc9.i386.rpm /mnt/ftp
cp: cannot create regular file `/mnt/ftp/curlftpfs-0.9.2-1.fc9.i386.rpm': No such file or directory
$ ll /mnt/ftp
-rw-r--r-- 1 root root 0 2008-08-07 16:28 curlftpfs-0.9.2-1.fc9.i386.rpm
$ cp curlftpfs-0.9.2-1.fc9.i386.rpm /mnt/ftp
Curl debug log:
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56
INIT: 7.9
flags=0x0000000b
max_readahead=0x00020000
INIT: 7.8
flags=0x00000001
max_readahead=0x00020000
max_write=0x00020000
unique: 1, error: 0 (Success), outsize: 40
unique: 2, opcode: GETATTR (3), nodeid: 1, insize: 56
unique: 2, error: 0 (Success), outsize: 112
unique: 3, opcode: LOOKUP (1), nodeid: 1, insize: 71
LOOKUP /curlftpfs-0.9.2-1.fc9.i386.rpm
ftpfs: operation ftpfs_getattr failed because No such file or directory
unique: 3, error: -2 (No such file or directory), outsize: 16
unique: 4, opcode: LOOKUP (1), nodeid: 1, insize: 71
LOOKUP /curlftpfs-0.9.2-1.fc9.i386.rpm
unique: 4, error: -2 (No such file or directory), outsize: 16
unique: 5, opcode: CREATE (35), nodeid: 1, insize: 79
ftpfs: operation ftpfs_getattr failed because No such file or directory
ftpfs: operation ftpfs_chmod failed because Operation not permitted
ftpfs: operation ftpfs_getattr failed because No such file or directory
unique: 5, error: -2 (No such file or directory), outsize: 16
unique: 6, opcode: GETATTR (3), nodeid: 1, insize: 56
unique: 6, error: 0 (Success), outsize: 112
unique: 7, opcode: OPENDIR (27), nodeid: 1, insize: 48
unique: 7, error: 0 (Success), outsize: 32
unique: 8, opcode: READDIR (28), nodeid: 1, insize: 80
unique: 8, error: 0 (Success), outsize: 200
unique: 9, opcode: LOOKUP (1), nodeid: 1, insize: 49
LOOKUP /backuppc
NODEID: 2
unique: 9, error: 0 (Success), outsize: 136
unique: 10, opcode: LOOKUP (1), nodeid: 1, insize: 71
LOOKUP /curlftpfs-0.9.2-1.fc9.i386.rpm
NODEID: 3
unique: 10, error: 0 (Success), outsize: 136
unique: 11, opcode: LOOKUP (1), nodeid: 1, insize: 49
LOOKUP /services
NODEID: 4
unique: 11, error: 0 (Success), outsize: 136
unique: 12, opcode: READDIR (28), nodeid: 1, insize: 80
unique: 12, error: 0 (Success), outsize: 16
unique: 13, opcode: RELEASEDIR (29), nodeid: 1, insize: 64
unique: 13, error: 0 (Success), outsize: 16
unique: 14, opcode: GETATTR (3), nodeid: 1, insize: 56
unique: 14, error: 0 (Success), outsize: 112
unique: 15, opcode: GETXATTR (22), nodeid: 1, insize: 65
unique: 15, error: -38 (Function not implemented), outsize: 16
unique: 16, opcode: OPENDIR (27), nodeid: 1, insize: 48
unique: 16, error: 0 (Success), outsize: 32
unique: 17, opcode: READDIR (28), nodeid: 1, insize: 80
unique: 17, error: 0 (Success), outsize: 200
unique: 18, opcode: LOOKUP (1), nodeid: 1, insize: 49
LOOKUP /backuppc
NODEID: 2
unique: 18, error: 0 (Success), outsize: 136
unique: 19, opcode: LOOKUP (1), nodeid: 1, insize: 71
LOOKUP /curlftpfs-0.9.2-1.fc9.i386.rpm
NODEID: 3
unique: 19, error: 0 (Success), outsize: 136
unique: 20, opcode: LOOKUP (1), nodeid: 1, insize: 49
LOOKUP /services
NODEID: 4
unique: 20, error: 0 (Success), outsize: 136
unique: 21, opcode: READDIR (28), nodeid: 1, insize: 80
unique: 21, error: 0 (Success), outsize: 16
unique: 22, opcode: RELEASEDIR (29), nodeid: 1, insize: 64
unique: 22, error: 0 (Success), outsize: 16
unique: 23, opcode: GETATTR (3), nodeid: 1, insize: 56
unique: 23, error: 0 (Success), outsize: 112
unique: 24, opcode: LOOKUP (1), nodeid: 1, insize: 71
LOOKUP /curlftpfs-0.9.2-1.fc9.i386.rpm
NODEID: 3
unique: 24, error: 0 (Success), outsize: 136
unique: 25, opcode: SETATTR (4), nodeid: 3, insize: 128
unique: 25, error: 0 (Success), outsize: 112
unique: 26, opcode: OPEN (14), nodeid: 3, insize: 48
unique: 26, error: 0 (Success), outsize: 32
OPEN[153990968] flags: 0x8001 /curlftpfs-0.9.2-1.fc9.i386.rpm
unique: 27, opcode: WRITE (16), nodeid: 3, insize: 4160
WRITE[153990968] 4096 bytes to 0
WRITE[153990968] 4096 bytes
unique: 27, error: 0 (Success), outsize: 24
unique: 28, opcode: WRITE (16), nodeid: 3, insize: 4160
WRITE[153990968] 4096 bytes to 4096
WRITE[153990968] 4096 bytes
unique: 28, error: 0 (Success), outsize: 24
unique: 29, opcode: WRITE (16), nodeid: 3, insize: 4160
WRITE[153990968] 4096 bytes to 8192
WRITE[153990968] 4096 bytes
unique: 29, error: 0 (Success), outsize: 24
unique: 30, opcode: WRITE (16), nodeid: 3, insize: 4160
WRITE[153990968] 4096 bytes to 12288
WRITE[153990968] 4096 bytes
unique: 30, error: 0 (Success), outsize: 24
unique: 31, opcode: WRITE (16), nodeid: 3, insize: 4160
WRITE[153990968] 4096 bytes to 16384
WRITE[153990968] 4096 bytes
unique: 31, error: 0 (Success), outsize: 24
unique: 32, opcode: WRITE (16), nodeid: 3, insize: 4160
WRITE[153990968] 4096 bytes to 20480
WRITE[153990968] 4096 bytes
unique: 32, error: 0 (Success), outsize: 24
unique: 33, opcode: WRITE (16), nodeid: 3, insize: 4160
WRITE[153990968] 4096 bytes to 24576
WRITE[153990968] 4096 bytes
unique: 33, error: 0 (Success), outsize: 24
unique: 34, opcode: WRITE (16), nodeid: 3, insize: 4160
WRITE[153990968] 4096 bytes to 28672
WRITE[153990968] 4096 bytes
unique: 34, error: 0 (Success), outsize: 24
unique: 35, opcode: WRITE (16), nodeid: 3, insize: 4160
WRITE[153990968] 4096 bytes to 32768
WRITE[153990968] 4096 bytes
unique: 35, error: 0 (Success), outsize: 24
unique: 36, opcode: WRITE (16), nodeid: 3, insize: 2301
WRITE[153990968] 2237 bytes to 36864
WRITE[153990968] 2237 bytes
unique: 36, error: 0 (Success), outsize: 24
unique: 37, opcode: FLUSH (25), nodeid: 3, insize: 64
FLUSH[153990968]
unique: 37, error: 0 (Success), outsize: 16
unique: 38, opcode: RELEASE (18), nodeid: 3, insize: 64
RELEASE[153990968] flags: 0x8001
unique: 38, error: 0 (Success), outsize: 16
Logged In: YES
user_id=737586
Originator: YES
More information:
The command touch works:
$ touch /mnt/ftp/test ; echo $?
0
Debug log:
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56
INIT: 7.9
flags=0x0000000b
max_readahead=0x00020000
INIT: 7.8
flags=0x00000001
max_readahead=0x00020000
max_write=0x00020000
unique: 1, error: 0 (Success), outsize: 40
unique: 2, opcode: LOOKUP (1), nodeid: 1, insize: 45
LOOKUP /test
ftpfs: operation ftpfs_getattr failed because No such file or directory
unique: 2, error: -2 (No such file or directory), outsize: 16
unique: 3, opcode: CREATE (35), nodeid: 1, insize: 53
ftpfs: operation ftpfs_chmod failed because Operation not permitted
ftpfs: operation ftpfs_getattr failed because No such file or directory
unique: 3, error: -2 (No such file or directory), outsize: 16
unique: 4, opcode: LOOKUP (1), nodeid: 1, insize: 45
LOOKUP /test
NODEID: 2
unique: 4, error: 0 (Success), outsize: 136
unique: 5, opcode: SETATTR (4), nodeid: 2, insize: 128
unique: 5, error: 0 (Success), outsize: 112
BUT pipes does not when file does not already exists:
$ > /mnt/ftp/test
-bash: /mnt/ftp/test: No such file or directory
Debug log:
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56
INIT: 7.9
flags=0x0000000b
max_readahead=0x00020000
INIT: 7.8
flags=0x00000001
max_readahead=0x00020000
max_write=0x00020000
unique: 1, error: 0 (Success), outsize: 40
unique: 2, opcode: LOOKUP (1), nodeid: 1, insize: 45
LOOKUP /test
ftpfs: operation ftpfs_getattr failed because No such file or directory
unique: 2, error: -2 (No such file or directory), outsize: 16
unique: 3, opcode: CREATE (35), nodeid: 1, insize: 53
ftpfs: operation ftpfs_chmod failed because Operation not permitted
ftpfs: operation ftpfs_getattr failed because No such file or directory
unique: 3, error: -2 (No such file or directory), outsize: 16