Q-Operating-System icon indicating copy to clipboard operation
Q-Operating-System copied to clipboard

Improving file catalogue

Open plankp opened this issue 10 years ago • 15 comments

Currently files must fit into a 256 char array. Files smaller can be fixed with strTrim but bigger files cannot be read entirely.

plankp avatar Nov 19 '15 02:11 plankp

I just came up with a fix. Oops!

plankp avatar Nov 19 '15 02:11 plankp

Wouldn't it be better to read it in N bytes parts? (for some constant N)

Niko-sk2x avatar Nov 19 '15 02:11 Niko-sk2x

Yeah

plankp avatar Nov 19 '15 02:11 plankp

But what happened before is that it would only read 256 bytes

plankp avatar Nov 19 '15 02:11 plankp

I should have the kernel read 256 every chunk

plankp avatar Nov 19 '15 02:11 plankp

and multiple chunks every file

plankp avatar Nov 19 '15 02:11 plankp

(Correct?)

plankp avatar Nov 19 '15 02:11 plankp

I think so. The current implementation allocates memory for the whole file. For small files it's good enough (and without multitasking there is no reason to ever "cat" bigger files. But when/if the OS gets real filesystem support - it current implementation will break).

Niko-sk2x avatar Nov 19 '15 02:11 Niko-sk2x

K got it. So 256 chars per chunk?

plankp avatar Nov 19 '15 02:11 plankp

For now 256 should be ok. It can be changed if needed. If you really wanted you cold read byte by byte. But it would be much slower.

Niko-sk2x avatar Nov 19 '15 02:11 Niko-sk2x

I (for some reason) tried my way, and paging fault will appear!

plankp avatar Nov 19 '15 21:11 plankp

):

raphydaphy avatar Nov 20 '15 21:11 raphydaphy

I think in Barteks2x branch, there is a partial solve (dunno)

plankp avatar Nov 20 '15 22:11 plankp

ill look at his fork \

raphydaphy avatar Nov 20 '15 22:11 raphydaphy

k

plankp avatar Nov 20 '15 22:11 plankp