Menu

#3 Overwrite existing files

open
nobody
Enhancement (3)
5
2007-01-03
2007-01-03
Stefan Lang
No

When trying to overwrite an existing file on the NXT brick (e.g. a newer version of a .rxe file), linxt returns an error.

There should be an option to automagically or by command line option overwrite existing files or/and to delete files from the NYT brick.

Discussion

  • igb

    igb - 2007-01-07

    Logged In: YES
    user_id=1657486
    Originator: NO

    This would be also #1 on my wish list.

     
  • Stefan Lang

    Stefan Lang - 2007-02-01

    Logged In: YES
    user_id=954733
    Originator: YES

    philoware has posted a patch that works fine (see patches section). I think this should be added to the main code.

     
  • Patrick Senti

    Patrick Senti - 2007-07-20

    Logged In: YES
    user_id=754944
    Originator: NO

    I have created a patch to enable linxt to delete a file on the brick. Apply the following patch to modify linxt.

    Usage: linxt -delete filename.rxe

    You may combine -delete and -upload in the same statement to replace an already existing file:
    linxt -delete filename.rxe upload filename.rxe

    6a7,9
    > #
    > # M001-allow delete files
    > # modification by Patrick Senti <patrick.senti@gmx.net>
    44a48,50
    > # M001
    > my $DELETE_FILE_COMMAND = 0x85;
    >
    56,57c62,64
    < 'setname|s=s' => \$opts{setname}
    < );
    ---
    > 'setname|s=s' => \$opts{setname},
    > 'delete|d=s' => \$opts{delete}
    > );
    70a78,81
    >
    > # M001
    > if ($opts{delete}) { delete_file($opts{delete}, $devref); }
    >
    73a85
    >
    194a207,220
    > # M001
    > sub delete_file
    > {
    > my ($file_name, $dev) = @_;
    > my ($outbuf, $inbuf);
    >
    > # delete the file
    > $outbuf = pack("CCZ20", $SYSTEM_COMMAND, $DELETE_FILE_COMMAND, $file_name);
    > $inbuf = doUSB($outbuf, $dev);
    >
    > my ($reply, $command, $status, $file_name_out) = unpack("C3Z20", $inbuf);
    > printf("File deleted: %s Status: %x (0=success, >0=error, not deleted)\n", $file_name_out, $status);
    > }
    >
    321c347
    < }
    \ No newline at end of file
    ---
    > }

     

Log in to post a comment.

MongoDB Logo MongoDB