Steve,

I'm almost certain that you can't access files on a share that way using standard file I/O

I think you have to mount the remote share.

https://wiki.samba.org/index.php/Mounting_samba_shares_from_a_unix_client

Hope it helps.

Mark


On 18/01/2013 23:56, Steve Cookson wrote:
Hi Guys,

I'm sure this is a really obvious question and, in fact, I thought it
was working just a day or so ago. I'm trying to do:

  
Wx::Bitmap->new('smb://userid:password@127.0.0.1/sharename/path/bitmapfile.png',
wxBITMAP_TYPE_ANY)

and I get file not found, when the file clearly exists if I type:

smb://userid:password@127.0.0.1/sharename/path

into Kubuntu dolphin file manager.

Here is a quick piece of runnable code that I generated with the
wonderful and ever accommodating wxGlade to show the problem:

(don't forget to change the path to a valid share/path/filename).

Regards

Steve.

#!/usr/bin/perl -w --
# To get wxPerl visit http://wxPerl.sourceforge.net/

package MyDialog;

use Wx qw[:everything];
use base qw(Wx::Dialog);
use strict;
sub new {
        my( $self, $parent, $id, $title, $pos, $size, $style, $name ) = @_;
        $parent = undef              unless defined $parent;
        $id     = -1                 unless defined $id;
        $title  = ""                 unless defined $title;
        $pos    = wxDefaultPosition  unless defined $pos;
        $size   = wxDefaultSize      unless defined $size;
        $name   = ""                 unless defined $name;

        $style = wxDEFAULT_DIALOG_STYLE unless defined $style;

        $self = $self->SUPER::new( $parent, $id, $title, $pos, $size, $style, 
$name );
        $self->{bitmap_1} = Wx::StaticBitmap->new($self, -1,
Wx::Bitmap->new('smb://userid:password@127.0.0.1/sharename/path/bitmapfile.png',
wxBITMAP_TYPE_ANY), wxDefaultPosition, wxDefaultSize, );

        $self->SetTitle("dialog_1");

        $self->{sizer_1} = Wx::BoxSizer->new(wxHORIZONTAL);
        $self->{sizer_1}->Add($self->{bitmap_1}, 0, 0, 0);
        $self->SetSizer($self->{sizer_1});
        $self->{sizer_1}->Fit($self);
        $self->Layout();
        
        return $self;
}

1;

package main;

unless(caller){
        local *Wx::App::OnInit = sub{1};
        my $app = Wx::App->new();
        Wx::InitAllImageHandlers();

        my $dialog_1 = MyDialog->new();

        $app->SetTopWindow($dialog_1);
        $dialog_1->Show(1);
        $app->MainLoop();
}


Reply via email to