Board.KolibriOS.org

Official KolibriOS board
It is currently Sun Aug 25, 2019 11:18 am

All times are UTC+03:00




Post new topic  Reply to topic  [ 75 posts ]  Go to page Previous 1 2 3 4 5 Next
Author Message
 Post subject: Re: FTP client
PostPosted: Thu Feb 01, 2018 12:21 pm 
Offline

Joined: Sun Oct 30, 2011 6:43 pm
Posts: 1499
nisargshah95, i think it is possible to do like in info3ds app.
To copy the icons into distr it need to edit Tupfile.lua http://websvn.kolibrios.org/filedetails ... a#line-158


Top
   
 Post subject: Re: FTP client
PostPosted: Thu Feb 08, 2018 9:05 pm 
Offline
KSoC/GSoC Student

Joined: Thu Mar 03, 2016 6:49 pm
Posts: 42
Thanks 0CodErr. Is there any way to test this on local machine? Do I need to follow build instructions from root/build.txt?


Top
   
 Post subject: Re: FTP client
PostPosted: Mon Mar 12, 2018 8:07 pm 
Offline
KSoC/GSoC Student

Joined: Thu Mar 03, 2016 6:49 pm
Posts: 42
Writing to log file at /usbhd0/1/ftpc.log fails with "access denied" error. It writes successfully if i compile and run ftpc from /usbhd0/1/. Why does the ftpc from the image give this error? Will it work if I change log destination to /tmp0/1/?


Top
   
 Post subject: Re: FTP client
PostPosted: Mon Mar 12, 2018 8:49 pm 
Offline

Joined: Sun Oct 30, 2011 6:43 pm
Posts: 1499
nisargshah95, which filesystem do you use on /usbhd0/1 ?
nisargshah95 wrote:
Will it work if I change log destination to /tmp0/1/?
I think yes, on the tmp the FAT filesystem is used. Just try it.


Top
   
 Post subject: Re: FTP client
PostPosted: Mon Mar 19, 2018 7:59 pm 
Offline
KSoC/GSoC Student

Joined: Thu Mar 03, 2016 6:49 pm
Posts: 42
0CodErr wrote:
nisargshah95, which filesystem do you use on /usbhd0/1 ?

I use FAT (32-bit) on /usbhd0/1. I will try submitting a fix with /tmp0/1 and see if it works.


Top
   
 Post subject: Re: FTP client
PostPosted: Wed Mar 21, 2018 7:24 pm 
Offline
KSoC/GSoC Student

Joined: Thu Mar 03, 2016 6:49 pm
Posts: 42
0CodErr, it looks like there is still "Access denied" issue even after moving log location to /tmp0/1/ (Rev 7201).


Top
   
 Post subject: Re: FTP client
PostPosted: Wed Mar 21, 2018 8:40 pm 
Offline

Joined: Sun Oct 30, 2011 6:43 pm
Posts: 1499
nisargshah95, maybe you'll show some code?
How do you writing to log?


Top
   
 Post subject: Re: FTP client
PostPosted: Wed Mar 21, 2018 8:58 pm 
Offline
KSoC/GSoC Student

Joined: Thu Mar 03, 2016 6:49 pm
Posts: 42
0CodErr wrote:
How do you writing to log?

From programs/network/ftpc/ftpc.asm:637:
Code:
;;================================================================================================;;
write_to_file: ;//////////////////////////////////////////////////////////////////////////////////;;
;;------------------------------------------------------------------------------------------------;;
;? Writes input buffer to log file                                                                ;;
;;------------------------------------------------------------------------------------------------;;
;> eax = pointer to buffer                                                                        ;;
;> ecx = size of buffer                                                                           ;;
;;------------------------------------------------------------------------------------------------;;
;< eax = status of SF 70.3                                                                        ;;
;;================================================================================================;;
        cmp     [logfile_offset], -1 ; if offset == -1 => logging disabled
        jne     @f
        mov     eax, 0
        ret
      @@:
        mov     [filestruct2.subfn], 3
        m2m     [filestruct2.offset], [logfile_offset]
        mov     [filestruct2.size], ecx
        mov     [filestruct2.ptr], eax
        mov     [filestruct2.name], log_file
        mcall   70, filestruct2
        test    eax, eax
        jz      @f
        mov     [logfile_offset], -1 ; disable logging
        call    error_fs
        icall   ebx, interface_addr, interface.print, str_no_logging
        ret
      @@:
        mov     eax, [logfile_offset]
        add     eax, ecx
        mov     [logfile_offset], eax
        ret


Just to clarify, it works if I compile the FTPC source from /usbhd0/1 and run the compiled binary. Doesn't work for the FTPC packaged in Kolibri image.


Top
   
 Post subject: Re: FTP client
PostPosted: Wed Mar 21, 2018 9:09 pm 
Offline

Joined: Sun Oct 30, 2011 6:43 pm
Posts: 1499
Hmm, according to you code above it seems that used SysFn70.3:WriteFile only.
Maybe it need to use SysFn70.2 instead of SysFn70.3?

Below the code that i tested and it works fine:
Code:
; to compile: nasm -f bin test.asm -o test.kex
ORG 0
BITS 32
; ---------------------------------------------------------------------------- ;
STACK_SIZE        equ 256
; ---------------------------| Application Header |--------------------------- ;
MENUET01          db "MENUET01"
version           dd 1
program.start     dd START
program.end       dd END
program.memory    dd END + STACK_SIZE
program.stack     dd END + STACK_SIZE
program.params    dd 0
program.path      dd 0
; ---------------------------------------------------------------------------- ;
Buf:
db 'This is my data to save to log file.'
.end:
PathToMyLogFile db '/tmp0/1/MyLogFile.txt',0
Buffer dd Buf
Count dd (Buf.end - Buf)
Path dd PathToMyLogFile
; ---------------------------------------------------------------------------- ;
align 4
START:
; ---------------------------------------------------------------------------- ;
; Create\Rewrite file      ;   SysFn70.2
        push   dword [Path]
        dec    esp
        mov    byte[esp], 0
        push   dword [Buffer]
        push   dword [Count]
        push   dword 0
        push   dword 0
        push   dword 2
        mov    ebx, esp
        mov    eax, 70
        int    64
        add    esp, 25
; terminate                ;   SysFn-1
        or     eax, -1
        int    64
; ---------------------------------------------------------------------------- ;
align 4
END:


Top
   
 Post subject: Re: FTP client
PostPosted: Wed Mar 21, 2018 9:16 pm 
Offline
KSoC/GSoC Student

Joined: Thu Mar 03, 2016 6:49 pm
Posts: 42
0CodErr, I think you are right. On reading sysfuncs.txt carefully, I see 70.3 is for writing to existing file. Using 70.2 should work. Thanks very much!


Top
   
 Post subject: Re: FTP client
PostPosted: Mon Mar 26, 2018 6:48 pm 
Offline
KSoC/GSoC Student

Joined: Thu Mar 03, 2016 6:49 pm
Posts: 42
According to sysfuncs.txt for 70.3,
Quote:
* The file must already exist, otherwise function returns eax=5.

But I get eax=10. How is this possible?


Top
   
 Post subject: Re: FTP client
PostPosted: Mon Mar 26, 2018 7:14 pm 
Offline

Joined: Sun Oct 30, 2011 6:43 pm
Posts: 1499
nisargshah95, is your app really can to find ini-file?


Top
   
 Post subject: Re: FTP client
PostPosted: Mon Mar 26, 2018 7:51 pm 
Offline
KSoC/GSoC Student

Joined: Thu Mar 03, 2016 6:49 pm
Posts: 42
0CodErr wrote:
nisargshah95, is your app really can to find ini-file?

It does. As I mentioned before, if I compile ftpc source on /usbhd0/1 and run it from there it can successfully create and write to file.


Top
   
 Post subject: Re: FTP client
PostPosted: Mon Mar 26, 2018 9:40 pm 
Offline

Joined: Sun Oct 30, 2011 6:43 pm
Posts: 1499
nisargshah95 wrote:
Doesn't work for the FTPC packaged in Kolibri image.
Is ini-file also packaged in the image?


Top
   
 Post subject: Re: FTP client
PostPosted: Tue Mar 27, 2018 6:47 pm 
Offline
KSoC/GSoC Student

Joined: Thu Mar 03, 2016 6:49 pm
Posts: 42
0CodErr wrote:
nisargshah95 wrote:
Doesn't work for the FTPC packaged in Kolibri image.
Is ini-file also packaged in the image?

No. I always assumed it would be. But I don't see the file in /rd/1/network. Thanks a lot! I'll try adding it to data/Tupfile.lua.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 75 posts ]  Go to page Previous 1 2 3 4 5 Next

All times are UTC+03:00


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited