Hi Taylor, thank you for the patch. Dne 26. března 2012 1:13 Taylor Killian <[email protected]> napsal(a): > This patch fixes a number of problems in the cat app. Most > importantly, it correctly displays characters at the end of the read > buffer, where previously multibyte characters were being rendered as > U_SPECIAL. It also implements the buffer size argument (-b) that the > --help mentions. The size of the buffer must be at least 4 though in > order to accommodate multibyte characters. Finally head (-H) and tail > (-t) were implemented as per --help. > > If head and tail are used at the same time, the result of the first > argument is fed into the second, so "cat -H 262 -t 4 textdemo" and > "cat -t 334 -H 4 textdemo" will both show the word "brew". In the > first example, the first (head) 262 bytes are read and the last (tail) > 4 of those 262 are displayed. In the second example, the last (tail) > 334 bytes are read and the first (head) 4 of those 334 bytes are > displayed. Using just head or just tail works as you would expect it > to. Nice feature indeed.
> > Oh, and I also made the hex (-x) output a little bit prettier. > > I am submitting this as part of my GSoC application [GSoC 2012 - UDF > 1.02 Implementation], and will most likely also be submitting patches > more related to my GSoC topic. I have a few comments to your patch. * we do use underscore_naming_for_variables, not camelCase * we put space between if and the parenthesis * your patch does not compile with latest mainline (str_uint64 was renamed to str_uint64_t two days ago), but that was easy to fix ;-) I do not like the way you typecast off64_t to uint64_t when reading the number from optarg. off64_t represents a signed number and you are reading it as an unsigned. Although I understand the motivation for using offset type, it just doesn't feel right. Plus, we do have an aoff64_t for absolute offsets. Otherwise, the patch looks okay to me. What I would like to see is an option for counting characters or lines instead of bytes. But this is really a wish, I definitely do not mean that we won't accept your patch without that or that you have to implement it. It may be a good exercise for someone else. > > I had a few questions while I was writing this that I thought I might > ask. The first is, is there a way to easily test an app without > rebooting qemu? Maybe a separate filesystem containing the app that No, currently rebuilding the disk image and rebooting the virtual machine is the only way. > can be mounted? Or an ftp transfer? Also, is there any way to scroll > up a console session? For example in Linux, pressing shift+page up. AFAIK there is no direct way. But you can redirect the output of a command to a file and then view that file using the text editor. Or you can telnet to HelenOS and work with bdsh from your Linux box. The scrolling would then depend on the capabilities of your Linux terminal. > Also, how do you change from the kernel console back to a virtual > console? Pressing the F1-11 buttons? (I need a new keyboard, the F > buttons don't always work). Type continue in there (or help to see list of existing commands). Bye, - Vojta > > Thanks for reading, please let me know what you think of the patch. > > Taylor Killian > > _______________________________________________ > HelenOS-devel mailing list > [email protected] > http://lists.modry.cz/cgi-bin/listinfo/helenos-devel > _______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/cgi-bin/listinfo/helenos-devel
