01-07-2012, 12:06 PM | #31 |
Addict
Posts: 224
Karma: 3184
Join Date: Feb 2011
Device: ONYX BOOX Note Air3 C
|
I doubt a script in a zipped file got converted, auto conversion is usually done on text file when using ftp, if you used ftp along the way to get the file where it is rkomar you might want to look into it.
Broadly speaking the only cases for auto-conversion I ever encountered were ftp transfers and text editors. Edit: I've checked and the file in the zip is definitely in unix format, so the most likely culprit is the text editor paola used. Last edited by J.C.; 01-07-2012 at 12:10 PM. |
01-07-2012, 01:55 PM | #32 | |
Wizard
Posts: 3,015
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
Quote:
It would be great to be able to download directly onto the ereader, but the browser on my 902 doesn't seem to allow that. Too bad! |
|
Advert | |
|
01-07-2012, 02:25 PM | #33 | |
Wizard
Posts: 3,015
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
Quote:
It might make more sense to just write an application that takes a URL and target filename as arguments and calls DownloadTo(), assuming that that automatically does the progress bar for you. In fact, such a program would come in handy for downloading the epub-edit.app we've been discussing directly to the ereader. I'll see if I can quickly bang something out for that. |
|
01-07-2012, 04:44 PM | #34 |
Member
Posts: 14
Karma: 10316
Join Date: Feb 2011
Device: Pocketbook pro 602
|
@rkomar
I meant it for scripts were you download more then one file, like an rss downloader. For example you download 10 files and the Progressbar adds 10% for each downloaded file. A menu system like in dialog on a regular shell woud be nice to. |
01-07-2012, 04:45 PM | #35 | |
Wizard
Posts: 2,832
Karma: 5843878
Join Date: Oct 2010
Location: UK
Device: Pocketbook Pro 903, (beloved Pocketbook 360 RIP), Kobo Mini, Kobo Aura
|
Quote:
|
|
Advert | |
|
01-07-2012, 07:15 PM | #36 | |
Wizard
Posts: 3,015
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
Quote:
|
|
01-07-2012, 07:23 PM | #37 | |
Wizard
Posts: 3,015
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
Quote:
I'm not sure what you mean by a menu system. I just added @bogomil's code for displaying multiple options in a dialog yesterday. Would that be what you're looking for? |
|
01-08-2012, 05:17 AM | #38 | |
Wizard
Posts: 2,832
Karma: 5843878
Join Date: Oct 2010
Location: UK
Device: Pocketbook Pro 903, (beloved Pocketbook 360 RIP), Kobo Mini, Kobo Aura
|
Quote:
As for poterm - yesterday for the first time I started seriously considering installing it, as in addition my laptop has not been "recognisign"the ereader when connecting via USB. I am somewhat daunted by the process, but I'll get there eventually |
|
01-08-2012, 07:21 AM | #39 | |
Wizard
Posts: 3,015
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
Quote:
Installing poterm is easy, but using it is the hard part, in that you have to learn the Unix shell commands for it. Last edited by rkomar; 01-08-2012 at 07:24 AM. |
|
01-08-2012, 07:41 AM | #40 | |
Wizard
Posts: 2,832
Karma: 5843878
Join Date: Oct 2010
Location: UK
Device: Pocketbook Pro 903, (beloved Pocketbook 360 RIP), Kobo Mini, Kobo Aura
|
Quote:
I am happy to give it a go to - to these look like reasonable places to start? http://freeengineer.org/learnUNIXin10minutes.html https://supportweb.cs.bham.ac.uk/doc...scripting.html |
|
01-08-2012, 05:34 PM | #41 | |
Wizard
Posts: 3,015
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
Quote:
Bear in mind that poterm doesn't really have a proper terminal, so the more complicated stuff that manipulates the screen (like using an editor) doesn't really work there. But it is fine for quick commands like copying or moving files around, showing file contents,... It's not for everyone, but having shell access is a great way to see into the "black box" of the ereader. They really are full blown computers. |
|
01-08-2012, 06:14 PM | #42 |
Wizard
Posts: 2,832
Karma: 5843878
Join Date: Oct 2010
Location: UK
Device: Pocketbook Pro 903, (beloved Pocketbook 360 RIP), Kobo Mini, Kobo Aura
|
thanks: slowly but surely, I'll give it a go!
|
01-10-2012, 07:49 AM | #43 |
Member
Posts: 21
Karma: 12650
Join Date: Apr 2011
Device: PB903
|
I am trying to introduce a new option -v for viewing a file in the tool but face the following problem: there are some characters after the end of the line - see below:
The code: Code:
void choose_line(){ int i=0,j=0; char* p=NULL; toc = (tocentry*)malloc(1024*sizeof(tocentry)); FILE* pInFile = fopen (path, "rt"); char strLine [1024]; // if your file has longer lines, make it bigger if (pInFile) { while ((p=fgets(strLine, sizeof (strLine), pInFile))) { // Remove trailing ' ' for(;j<strlen(strLine) && p[j]==' ';j++) p+=1; toc[i].level = 1; toc[i].page = 0; toc[i].position = i; toc[i].text = strdup(p); toc[i+1].level = 2; toc[i+1].page = 0; toc[i+1].position = i+1; toc[i+1].text = strdup("next level"); i+=2; } fclose (pInFile); numfiles=i; } OpenContents(toc, i, 0, fileselect_handler); } Last edited by bogomil; 01-10-2012 at 07:52 AM. |
01-10-2012, 11:40 AM | #44 |
Addict
Posts: 224
Karma: 3184
Join Date: Feb 2011
Device: ONYX BOOX Note Air3 C
|
Without consulting a C reference I'd say that if you're assuming that every line is the same size you might be displaying an area in memory that you allocated for the line but didn't fill when you read it.
|
01-10-2012, 01:16 PM | #45 |
Wizard
Posts: 3,015
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
@bogomil
That for loop looks like it is really for removing spaces from the beginning of the line rather than the trailing spaces as the comment says. The problem with it is that the index variable j is never reset for the next line. So, putting the initializer j=0 into the for loop should fix that. Personally, I would have just used a while loop for this: Code:
while (*p == ' ') p++; Finally, it's worth checking to see if i>0 before calling OpenContents, otherwise it hangs the program if there are no lines to show. Edit: I forgot to add that files with more that 512 lines are going to start corrupting your program, because you will be writing past the end of toc. You need to realloc more space before then. Last edited by rkomar; 01-10-2012 at 01:23 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Trio of Picture Books - Simple Animals, Simple Shapes, and You're My Baby! | Manley Peterson | Self-Promotions by Authors and Publishers | 5 | 01-06-2012 09:55 PM |
Application update: application not installed error | Merischino | Kindle Fire | 4 | 12-01-2011 11:30 PM |
erm, simple question , hope for simple answer! | al zymers | Amazon Kindle | 5 | 09-25-2010 02:01 PM |
Simple question for a simple mind :) | PKFFW | OpenInkpot | 6 | 08-27-2009 10:00 PM |
Television scripts for your handheld | Bob Russell | Lounge | 2 | 01-07-2006 07:22 PM |