Sign in to follow this  
Followers 0
EddieBoy

Maximum FileSetPos jump?

15 posts in this topic

I'm trying to make a script that will operate on large data files but FileSetPos {from file beginning} seems to have a limit. If I try to jump to FileSetPos($x,0xab36a000,0) it goes to 65536 instead.

Does anyone know what the limit is? Maybe I can use multiple "1" jumps from "current position", or maybe I'm doing something wrong.

Share this post


Link to post
Share on other sites



#4 ·  Posted (edited)

Try this

FileSetPos($x,Dec('0xab36a000',1),0)

I get a "wrong # of arguments" error with these.

I guess Autoit forces singed hex values so nothing above 0x7fffffff.

I tried to find a list of limits in the helpfile but landed in the "Autoit Limits/Defaults" section which doesn't mention this limitation.

Edited by EddieBoy

Share this post


Link to post
Share on other sites

@EddieBoy, use latest stable version of AutoIt. Older versions contain bugs that newer versions don't. Maybe that's the case with with your code which should work just fine btw.

That suggestion with Dec() is just lame (not to use word "stupid") so forget about it.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Thanks for your help.

I updated Autoit to v3.3.8.1, but it still won't set the file position when using a hex value above 0x7FFFFFFF

Anything above Dec(0x7FFFFFFF,2) returns error (0).

_WinAPI_SetFilePointer() sounds like it will work, but I'll have to rewrite my code some to fit it in.

A sample, but it needs a "test.bin" larger than 0xab36a000:

$x = FileOpen("test.bin")
FileSetPos($x,0xab36a000,0)
MsgBox(0,"", FileGetPos($x))
FileClose($x)
Edited by EddieBoy

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I tested more and found out it works if I put 0xab36a000 in quotes. As in:

$x = FileOpen("test.bin")
FileSetPos($x,"0xab36a000",0)
MsgBox(0,"", FileGetPos($x))
FileClose($x)

I guess Autoit handles hex differently when in quotes. In my program, this value (0xab36a000) comes from user input. I"ll do some tests and hopefully figure out how to get it working well.

Thanks everyone!

Edited by EddieBoy

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

That suggestion with Dec() is just lame (not to use word "stupid") so forget about it.

Instead of your cryptic answers just be exact why do you think it's not correct!

I didn't test my examples but I see no problem why it should be incorrect (maybe just removing 0x).

EDIT:

This your answer is your typical negativistic answer instead of forum's common constructive one.

Edited by Zedna

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

I thought your Dec(0x##,2) answer made sense Zedna, based on the "Dec()" description in the helpfile. Treating a hex value as 64 bit seems like it would remove the 32bit signed limit. I don't understand why it didn't seem to work, but I'm new to programming so there's a lot I don't understand ;)

My program is working with user input higher than 7fffffff set up like this:

FileSetPos($BigFile, "0x" & GUICtrlRead($input), 0)
Edited by EddieBoy

Share this post


Link to post
Share on other sites

Instead of your cryptic answers just be exact why do you think it's not correct!

I didn't test my examples but I see no problem why it should be incorrect (maybe just removing 0x).

EDIT:

This your answer is your typical negativistic answer instead of forum's common constructive one.

Her answer was not cryptic. As she very clearly stated:

...your code which should work just fine btw.

That means all work-arounds including Dec() should not be necessary.

I will also add that telling the user to use a UDF instead of figuring out why the native function won't work is kind of dumb. Native functions should be favored so if a native function isn't working it's best to figure out why rather than forget it and move on to something else.

Zedna, I know you don't like trancexx but please stop looking for reasons to call her out. Her post wasn't cryptic, she answered the question and she pointed out that your suggestion was counter-productive.

Share this post


Link to post
Share on other sites

I will also add that telling the user to use a UDF instead of figuring out why the native function won't work is kind of dumb. Native functions should be favored so if a native function isn't working it's best to figure out why rather than forget it and move on to something else.

That's disadvanatge of AutoIt not being opensource. If there is no source available and no developer (with access to sources) wants to give constructive help then there are always available native API functions (as UDFs) where we exactly know what's going on there.

Zedna, I know you don't like trancexx but please stop looking for reasons to call her out. Her post wasn't cryptic, she answered the question and she pointed out that your suggestion was counter-productive.

Firstly trancexx hate me. My hate to her (him?) is not cause but only my reaction.

I wasn't the first who started these nonsense attacks here on the forum.

Yes I know every reaction of trancexx to me like this will be always personal.

Valik please look at other Devs/Mods/MVPs how they talk to other people on the forum and compare it to trancexx.

After that make your final results like this.

Share this post


Link to post
Share on other sites

That's disadvanatge of AutoIt not being opensource. If there is no source available and no developer (with access to sources) wants to give constructive help then there are always available native API functions (as UDFs) where we exactly know what's going on there.

She gave constructive help. She just didn't hold your and the OP's hand which you apparently need.

I wasn't the first who started these nonsense attacks here on the forum.

Really? You're going to play the "she started it" card? Grow the fuck up. Realize this as well, it doesn't matter who started it, you were the last person to engage in it - and still do. I grow weary of the he/she debate. She responds to being addressed as a female and presumably prefers being addressed as such since I've never seen any correction made. Thus it is irrelevant if she is really a man, woman, transsexual, or alien. Address her as she and stop with the childish behavior.

Yes I know every reaction of trancexx to me like this will be always personal.

That is your choice. Only you can stop interpreting everything she says as personal.

Valik please look at other Devs/Mods/MVPs how they talk to other people on the forum and compare it to trancexx.

After that make your final results like this.

No, I'd rather look at how trancexx speaks now compared to how she did a few short months ago. I see a concerted effort on her part to be more civil without compromising her identity. We exchange PMs frequently to discuss things and there's none of her old abrasive behavior present in them. She's now no worse in her treatment of others than I am. If she's fine with her forum behavior of late then I'm fine with it as well because it no longer crosses any lines I wouldn't cross myself.

Somehow I managed to go from disliking her and threatening to remove her to working with her to make this fucking language, I think the least you can do is stop taking everything she says so goddamn personal.

Share this post


Link to post
Share on other sites

Really? You're going to play the "she started it" card? Grow the fuck up. Realize this as well, it doesn't matter who started it, you were the last person to engage in it - and still do. I grow weary of the he/she debate. She responds to being addressed as a female and presumably prefers being addressed as such since I've never seen any correction made. Thus it is irrelevant if she is really a man, woman, transsexual, or alien. Address her as she and stop with the childish behavior.

From trancexx's person details showed on the forum

  • Gender:Not Telling
That was the first reason why he/she debates started here on the forum in past and it lasts up to now.

Share this post


Link to post
Share on other sites

Stupid reason is stupid.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0