<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div><div><div><div>On 4 maj 2011, at 13.49, Dave Challis wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On 04/05/11 12:45, Ahmed Omar wrote:<br><blockquote type="cite">You wanted file:write_file/2 i guess<br></blockquote><br>Oops, that was a mistake in the original post.<br><br>I've tried both:<br><br>file:write_file("/tmp/foo", Data).<br><br></div></blockquote><div><br></div>Nearly the same thing as below.</div><div><br><blockquote type="cite"><div>and<br><br>{ok, Fp} = file:open("/tmp/foo", [write]).<br>file:write(Fp, Data).<br><br>Both give {error,badarg} when Data > 2Gb, and write the file fine otherwise.<br><br></div></blockquote><div><br></div><div><br></div>Looks like the problem is in beam/utils/io_list_len.<div>io_list_len returns an int, which is 32 bit on x64_64.</div><div>The return type should probably be Sint, but the all calls to io_list_len must</div><div>be updated accordingly.</div><div><br></div><div>Workaround: write in smaller chunks.</div><div><br></div><div>/Tony</div><div><br></div></div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="font-family: Verdana, Arial, Tahoma; font-size: 12px; "><i>"Have run Make so many times I dunno what's installed anymore"</i></span></div></span></span>
</div>
<br></div></div></body></html>