Subject: Re: Megatools code contribution
From: Leichtenfels
Date: Sat, 13 Mar 2021 11:20:24 +0000
Hi Ondrej,

I don't know if you are still interested in the sync functionality for megatools; anway, if this is the case, I have today noticed a bug that occurs when g_stat'ing large files (> 2 GB or so): "Value too large for defined data type". To avoid this problem, the following should be inserted into sync.c before the #includes:

// necessary to avoid "Value too large for defined data type" when calling g_stat
#define _FILE_OFFSET_BITS 64

Kind regards and have a nice weekend

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Am Mittwoch, 5. Juni 2019 16:32 schrieb Ondřej Jirman <>:

> Hello Leo,
> On Wed, Jun 05, 2019 at 02:26:43PM +0000, Leichtenfels wrote:
> > Hi Ondřej
> > Thanks for merging.
> > On Wednesday, 5. June 2019 15:37, Ondřej Jirman wrote:
> >
> > > Though this may cause compatibility trouble with other programs, if they impose
> > > sanity/size limits on node attributes. So it's a bit risky.
> >
> > Yes, there are some issues with this function, and I have mixed feelings about
> > it as well. There are only a few file systems on Linux that allow unlimited
> > attribute sizes, though. Definite info is hard to find unfortunately.
> > I couldn't find out either whether Mega imposes a limit on custom attributes
> > and whether they reduce storage space or not but I suppose this is the case.
> > Most xattrs I have encountered so far are short, few hundred bytes or so max.
> > However, maybe it is better to add an option to explicitly enable them, so
> > it's the responsibility of the user ;-) Perhaps add an 'int flags' to the
> > signature of the upload methods for controlling this behavior from the tools?
> Yeah. I wouldn't worry, ATM. I'll attempt to create a "transfer manager" as
> I noted previously, and most of this functionality and options will be pushed
> there. So there's no need to add options now.
> > > Good point, it will not compile. I may end up needing to revert it or add some
> > > ifdefs.
> >
> > I would have added the ifdefs but so far I couldn't find any in the codebase
> > and I have currently no windows compile environment, so I thought it's better
> > to leave it up to you.
> No problem, I'll do it.
> regards,
> o.
> > Greetings, Leo