-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Much larger destination files (null padded) #17
Comments
So I did fix my text file issue by truncating after the fact, but would still be interested to know why this is. Issue can otherwise be removed |
Just to get the terminology straight (As far as I understand it!), nothing here is related to Samba. Samba is another open source library built around the SMB/CIFS protocol, but it's unusable on iOS because of its restrictive licensing (Hence why Hmmm, so at the moment, this library just loops through a As far as I know, you're guaranteed to know the size of the file ahead of time, so it might just be a matter of ensuring the number of bytes read doesn't exceed that number. I'll have to run some tests on my own to see if that's actually the case. :) |
Ah yes. I was referring to the libdsm library. Regardless of why I didn't write that, still relatively new to all these terms and it's nice to have everything cleared up! Now, if a fix were in fact to be implemented, I'd assume it'd best go to libdsm if anything as you said, but again, don't know if this is a feature or a bug That said, my workaround for the meantime is to truncate the file after it's been downloaded. Your client seems to recognize the correct number of bytes, so as of now, I honestly have no clue where this 'feature' or 'bug' is coming from Lastly, thanks for the amazing client! Works wonderfully indeed |
I have similar problem. The original file is 97KB, the downloaded one 197KB. That's a zip file. I can uncompress in on my OS X, but I cannot do it correctly on iOS (SSZipArchive). Probably also will have to truncate the file, however in my case it is not null padded. First 97KB is equal to the original file, then there's some random HEX written - not nulls.
|
@natalia-osa by the way with the following code Im able to fix the zip issue. while ((bytesRead < self.file.fileSize))
} |
I'm not sure if this is supposed to be this way, but it seems that when I try downloading any file, the file is null padded to a larger size. I searched this up, and I believe it has something to do with 'speculative preallocation'
Now, is this a known property of samba, or is there a workaround to get the original with same file size? (besides manually truncating)
My issue seems to be with text files (images seem to work fine either way). If I have a really small text file, let's say 40 bytes in size. The new text file that has been downloaded is now the original 40 bytes, with an additional ~100,000 null bytes
When reading out this file, I have the contents of the file being printed out twice, which I am assuming is because of the null characters.
Could anyone explain why this is, or if there is anyway around it?
Thanks
The text was updated successfully, but these errors were encountered: