Oliver wrote:
Hi lodger,
First of all I'd like to mention that I'm supposed to get email notification on answers in this thread but I didn't receive one for your post. I rather saw it yesterday my chance

So if you (or any other Contiki programmer) has a specific question and I seem to igonore postings in this board feel free to drop me an email: ol.sc at web.de
lodger wrote:
Well, the cfs_read command works, but it seems like you can't write data to a file (on the c64 platform, native and with VICE) using cfs_write. I've attached my example code,
Thannks for the example code. This makes analysis obviosly much simpler

Pleased to help you on this. Since you've got a .de mail address, I'm pretty sure I'll get back to you directly via mail next time using our native language, which is german I persume?

Oliver wrote:
Now the CFS_WRITE flag translates straight to O_CREAT | O_TRUNC | O_WRONLY without "trying to be smart".
lodger wrote:
feel free to try it. It just won't work.
Was there a part of the conversion in which you told me about this "can read but can't write" issue and I said "Bullshit !" that I don't remember anymore ?
As I said before: english is not my native language. So sometimes I pick the wrong words / phrases. What I really wanted to say was: feel free to try it out and hopefully you'll agree with me. Sorry for sounding so offending!
Oliver wrote:
I just fixed this in the CVS head revision. In case you're interested in the background:
Up to now the CFS_WRITE flag was translated into the POSIX flags O_CREAT | O_TRUNC | O_RDWR. This was done for precaution and to potentially increase comptibility as most systems implicate read access rights for write access rights. However now I learned that the cc65 POSIX file I/O library for CBM treats O_RDWR as an error in general - most likely due to limitations of the CBM DOS, but as you know my CBM knowledge is extremly limited...
Thank you, Oliver - that's very kind of you

!
Just to let you know: I've been playing with the apps/shell and apps/telnetd code, getting to know Contiki 2.x a little better. I've implemented a small "login" routine to the shell, so the C64 checks a plain text file on the 1541 drive containing a username and password before popping into the shell. But it's simple, e.g. no encryption or blanked out passwords during login. Also, I've added two new processes / commands to the shell to write and read a text string to/from floppy disk. The "authentication" stuff uses <stdio.h> for reading the user/password file. However, the two new shell commands I've implemented use <cbm.h> for doing disk I/O as <stdio.h> based code (fopen, fscanf etc.) won't work within the PROCESS_BEGIN / PROCESS_END blocks. If you run it, the floppy disk drive starts to spin and the LED lights up, but then it just keeps spinning useless. You may even open the drive and take out the disk and the drive doesn't care. <cbm.h> based code (using cbm_open/cbm_close and cbm_read/cbm_write) works within PROCESS blocks, but cbm_open always returns 0 (zero) as a result, which is a bug within the cc65 compiler code. But everyone with a c64 or VICE can make proof of this.
As far as I know, unlike the Apple II disk controller(s), CBM hardware seems to be incapable of performing fseek(), fset() and ftell() with cc65. But I'm thankful for anyone explaining the correct reasons / details for these limitations.
So I'm very glad that I can now use Contiki CFS code. Be sure that I'm very thankful for any help you provide. Contiki is there and people like me are hell-bent to dig into this. Be sure, that I'll keep on digging!!
