linuxbashgoogle-drive-apitruncaterclone

Truncate not working with google-drive in command line


I am using rclone to work with Google Drive on the command line. I want to create a file of a specific size using truncate, but I get the error

$ truncate -s 4096 qwe
truncate: failed to truncate 'qwe' at 4096 bytes: Operation not permited

I understand that there are not enough permissions, but I don't know how to get them or how to get around it :(

Help me pls

UPD1:

I work remotely with a google disk, it is mounted to my server using rclone

screenshot

UPD2:

Everything works fine when I do it locally

screenshot


Solution

  • how to get around it :(

    Instead of truncate, which calls ftruncate, really create the file with all zeros.

    dd if=/dev/zero of=qwe bs=1M count=4