#19 Fix mkdir command in obexfs

closed-fixed
nobody
None
5
2007-06-02
2006-12-15
Anonymous
No

First of all let me thank you for the great software you provided:
it's really amazing.

I own a brand new SE K750i. In order to create a directory I noticed
that

obexftp -i -C Memory\ Stick/tmp

doesn't work, I need to first change to the subdirectory and THEN
create the directory, i.e. I need to use

obexftp -i -c Memory\ Stick -C tmp

Unfortunately, this means that the mkdir command in obexfs fails:

Challenger / # obexfs -i /mnt/cell
Challenger / # cd /mnt/cell/Memory\ Stick
Challenger /mnt/cell/Memory Stick # mkdir tmp
mkdir: cannot create directory `tmp': No such file or directory

I have fixed the problem by modifying slightly the ofs_mkdir
subroutine in obexfs.c. I include the modified subroutine at the end
of this email. Thank you again for your software and please let me
know if you need anything more.

All the best!

Lorenzo Maccone

--
Lorenzo Maccone

QUIT - Quantum Information Theory Group,
Dipartimento di Fisica "A. Volta",
Universita' di Pavia, via A. Bassi 6,
I-27100 Pavia (ITALY)

Tel.: +39-0382-987903
Fax.: +39-0382-987563
e-mail: maccone@unipv.it
Web: http://www.quantummechanics.it/-macca

********************************************************************************
NEW ofs_mkdir subroutine:
********************************************************************************

static int ofs_mkdir(const char *path, mode_t UNUSED(mode))
{
int res;
char *p;

if(!path || *path != '/')
return 0;

res = ofs_connect();
if(res < 0)
return res; /* errno */

p=strrchr(path,'/');

p[0]=0;
/*first change to the subdirectory:*/

(void) obexftp_setpath(cli, path, 0);

/*then create the directory:*/

(void) obexftp_setpath(cli, p+1, 1);

/*restore the path string:*/

p[0]='/';

ofs_disconnect();

return 0;
}

Discussion

  • Christian W. Zuckschwerdt

    • status: open --> closed-fixed
     
  • Christian W. Zuckschwerdt

    Logged In: YES
    user_id=136432
    Originator: NO

    Fixed in OBexFTP. Thanks!

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks