Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #244829

Re: why copying big file fails?

From "Thomas Schmitt" <scdbackup@gmx.net>
Newsgroups linux.debian.user
Subject Re: why copying big file fails?
Date 2022-01-30 23:00 +0100
Message-ID <DLqoO-3Qd-3@gated-at.bofh.it> (permalink)
References <DLp9o-3a7-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

a <loushanguan2015@sina.com> wrote:
> it fails: cp: error reading
> 'DCIM/ScreenRecorder/Screenrecorder-2022-01-30-12-29-58-111.mp4': Invalid
> argument
>
> i run "ls -l", about 2G has been copied

> i use bullseye for i386, intel core2 Q8200 2.33G

That's a machine whiere type "long" has 32 bit. I.e. the non-negative
range is 0 to 2,147,483,647.

2 GB limits are usually due to call fseek(3)

       int fseek(FILE *stream, long offset, int whence);
       ...
       EINVAL The whence argument to fseek() was not  SEEK_SET,  SEEK_END,  or
              SEEK_CUR.  Or: the resulting file offset would be negative.

So it would match the error message if the fseek offset value surpassed
2,147,483,647 bytes.

The seek() method of jmtpfs class MtpLocalFileCopy uses fseek(3):
  https://sources.debian.org/src/jmtpfs/0.5-3/src/MtpLocalFileCopy.cpp/?hl=90#L90
It is used by the Read() method of MtpFile
  https://sources.debian.org/src/jmtpfs/0.5-3/src/MtpFile.cpp/?hl=71#L71
So it would be plausible that this is the place where "Invalid argument"
comes from.


What happens if you try a program that is less suspicious of using
random access reading ?
Like:

  cat </the/jmtpfs/file/path >/the/ext4/file/path


Have a nice day :)

Thomas

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

why copying big file fails? a <loushanguan2015@sina.com> - 2022-01-30 21:20 +0100
  Re: why copying big file fails? "Andrew M.A. Cater" <amacater@einval.com> - 2022-01-30 21:20 +0100
    Re: why copying big file fails? a <loushanguan2015@sina.com> - 2022-01-30 21:40 +0100
      Re: why copying big file fails? "Andrew M.A. Cater" <amacater@einval.com> - 2022-01-30 22:00 +0100
      Re: why copying big file fails? "Thomas Schmitt" <scdbackup@gmx.net> - 2022-01-30 23:00 +0100
  Re: why copying big file fails? ghe2001 <ghe2001@protonmail.com> - 2022-01-30 21:30 +0100
    Re: why copying big file fails? a <loushanguan2015@sina.com> - 2022-01-31 00:00 +0100
  Re: why copying big file fails? Reco <recoverym4n@enotuniq.net> - 2022-01-30 22:10 +0100
    Re: why copying big file fails? Hans <hans.ullrich@loop.de> - 2022-01-30 22:30 +0100
      Re: why copying big file fails? Reco <recoverym4n@enotuniq.net> - 2022-01-31 07:20 +0100
    Re: why copying big file fails? Michael Stone <mstone@debian.org> - 2022-01-31 16:20 +0100
      Re: why copying big file fails? lou <loushanguan2015@sina.com> - 2022-01-31 22:20 +0100

csiph-web