2002.10_Easy Ftp Downloads with Kbear.pdf

(393 KB) Pobierz
Layout 1
LINUX USER
Ktools
Bear Necessities
If you are looking to use FTP for software downloads, specialized client
programs offer considerable advantages in comparision to using a web
browser. KBear can access several servers simultaneously, for example.
A fter first introducing the GUI
based FTP program KBear over 18
months ago in this column [1], it
looked as though program development
had come to a complete standstill. The
latest version (1.2.1) was from April the
previous year – and all has been quiet on
the bear-front since then.
Thank goodness that seems to have
changed now, and the first pre-release of
version 2.0 sees the program making the
jump to KDE 3.0. So, if you want to try
out the latest version of KBear from the
homepage at kbear.sourceforge.net , you
will need KDE 3.0 and Qt 3.0.x.
Updating is particularly easy for any
Mandrake users who can download a
pre-configured package from prdown U
loads.sourceforge.net/kbear/kbear-2. U
0alpha1-1mdk.i586.rpm. Users of other
systems will need to extract the source
code archive using
line in comparison to other FTP clients.
Before you get started, this second
generation program confronts you with a
so-called configuration wizard designed
to provide you with support while
configuring the program.
Keep the default settings in the first
two windows iView Settings and
Window Settings for the time being, and
click on the button marked Next> in
both cases to continue. Later you will be
able to access any items the wizard
presents at this stage, and even call the
wizard itself via the Settings / Run
Wizard … or Settings / Configure KBear
menu items.
If the “useful” tips provided when you
launch the program start to get on your
nerves, you will probably want to access
Mixed Settings and disable Run “Tip of
today” at startup.. If you forget to enter
your email settings in Network/Email in
the KDE control center, you can also use
this window to inform KBear of your
email address.
The last wizard window is used for
firewall settings (Figure 1). The default
value here is Do not use a firewall (most
users will use this) . You will definitely
want to keep this setting, as the firewall
configuration is still experimental. You
can then click on the Finish button to
launch the FTP client proper.
A Completely New Point of
View
The first time you start KBear (Figure 2),
you will not see the typical two-framed
window that you are familiar with from
tar -xIvf kbear-2.0alpha1.tar. U
bz2
and then launch their compiler (Box 1).
Figure 2: The initial window
First time out
The first time that you launch KBear by
typing kbear in your favorite terminal
emulation, or via the KDE menu entry
Internet / KBear , you will probably
notice that KBear steps somewhat out of
KTOOLS
In this column we present tools, month by
month, which have proven to be especially
useful when working under KDE, solve a
problem which otherwise is deliberately
ignored, or are just some of the nicer things
in life, which – once discovered – you
wouldn’t want to do without.
Figure 1: Omit the Firewall in the Alpha-Version
Figure 3: Free choice of FTP servers
70
October 2002
www.linux-magazine.com
KBear FTP Client
BY STEFANIE TEUFEL
591318313.008.png 591318313.009.png 591318313.010.png 591318313.011.png
Ktools
LINUX USER
other clients, where you have your home
directory on one side and the FTP server
on the other.
KBear uses a different approach even
here. You will still find your home
directory as expected, but most of the
window is reserved for the various FTP
servers that you might want to access in
future.
Compilation Tricks and Traps
Alpha versions always have a few rough edges – this is particularly true of the installation and
defnitely the case for KBear: Extreme caution and some resilience to setbacks should help.
The default setting for KBear will place the client in the /usr/local/kde/bin , /usr/local/kde/lib
directories, etc. This would mean the program crashing immediately on Red Hat 7.3. The solution is
to install the program in the directory reserved by Red Hat for KDE under /usr .To do so, we simply
called ./configure in the source directory kbear-2.0alpha1 and added --prefix=/usr .
If you have several KDE and Qt versions (including header files) ,you will need to point the
variables in KDEDIR and QTDIR to the correct version in the KBear source directory before you call
configure ,as in:
export QTDIR=/usr/lib/qt3
Outgoing
Bells and whistles are fine but an FTP
client is no use, unless you can convince
it to talk to FTP servers of your choice.
KBear provides you with two ways of
doing this: You can click on FTP / Quick
Connect (or use the keyboard shortcut
[Ctrl-N]) and type the address of the
required server in the dialog box that
then appears (Figure 3).
You will normally want to access
public FTP servers where you do not
possess an account . In this case you will
need to check Anonymous Login to
access that part of the server reserved for
anonymous logins.
After you enter your email address via
the wizard, KBear automatically uses
this email address as your password for
anonymous login – and this is what most
FTP servers expect. Note: Servers will
sometimes prompt you for a password
despite anonymous login . In this case
you should type anonymous in the
dialog box that pops up on your screen –
after doing so you should be able to log
on without any difficulty.
Are you ready? Just one more click on
export KDEDIR=/opt/kde3
The right directory differs from system to system. But even if configure seems to work, you should
not assume you have successfully compiled the tool. The compilers on SuSE 7.2 and Qt 3.0.3
refused to cooperate and instead issued a message to the effect of:
kbeardeletejob.cpp: In method `void KBearDeleteJob::slotEntries U
(KIO::Job *, const KIO::UDSEntryList &)':
kbeardeletejob.cpp:121: implicit declaration of function `int U
assert(...)'
make[3]: *** [kbeardeletejob.lo] Error 1
If a compiler complains about an implicity declared function, it normally means that the
programmer has forgotten to include a header file. If you add the following line at the beginning
of the kbearlistjob.cpp , kbearcopyjob.cpp , and kbearfilecopyjob.cpp files in kbear-2.0alpha1/kbear U
/base
#include <assert.h>
you should be able to compile the KBear sources without any problem.
the Connect button (provided you are
online) separates you from opening a
connection to the server of your choice
with a little help from KBear.
The Save to Sitemanager box in Figure
4 gives you an idea of the second
method of contacting FTP servers. Björn
Sahlströhm, KBear’s developer, used the
Sitemanager to organize a whole bunch
of FTP servers – neatly and tidily by type
and content – including their logins. If
you decide to access one of the servers in
this list, you simply click on the list
entry. You can use the above mentioned
box to add entries to the list.
Easy to import
KBear 1.2.1 veterans will be familiar
with [Ctrl-O] as a shortcut to opening the
Sitemanager configuration. The current
version now provides the additional
enhancement of allowing you to import
FTP bookmarks from other programs.
As you can see in Figure 4 this dialog
box not only
contains a bunch of
nicely organized
servers but also an
Import button. A
single click on this
button allows you
to use the dialog
box that pops up
(as you can see
in Figure 5) to
integrate your book-
marks from KBear
1.x, the GNOME
FTP program, the
ncFTP command
GLOSSARY
FTP: The “File Transfer Protocol” controls the
transfer of files from one computer to
another across the Internet. FTP allows
comprehensive file management after
logging on to the host system. Depending on
your access privileges, you can transfer,
delete, copy or move files and directories.
Header file: Files ending in .h contain
descriptions of how to call functions written
in the C or C++ programming languages.
They are essential for compiling programs. If
you use a package manager to install a
library, they are normally found in a separate
archive with the “dev” or “devel” suffix and
need to be added specifically.
Account: Access privilege for a Unix
computer. A user who possesses a user name
and password for this system and also has a
home directory based on this system, is said
to possess an account on the host.
Figure 4: Add a server of your choice to the Sitemanager!
www.linux-magazine.com
October 2002
71
71
October 2002
www.linux-magazine.com
591318313.001.png 591318313.002.png
LINUX USER
Ktools
/ Configure KBear / Views to view the
files in the folders on display as icons or
as a detailed list including rights, time-
stamps, and so on. This is also the place
to opt for a tree view, to display the
taskbar and the like.
After configuring the environment you
simply use drag & drop for your down-
loads, as one would expect from KDE.
Just click on the file you want to down-
load from a directory on the FTP source
server and drag your mouse to the target
directory on your local machine. Let go
of the mouse button and select copy in
the context menu that then appears –
finished. Now you can lean back and
watch the transfer progress indicator in
the bottom frame (Figure 8).
You can even take a peek at a file
before you download it. To do so, right-
click on the file and select View in the
drop-down menu. Depending on the file
type KBear will then offer you a selection
of programs to view the file contents in
advance and at your own pace.
Figure 5: Thanks to the new import function, you
can keep your bookmarks
INFO
[1] Stefanie Teufel:“Different Views”, Linux
Magazine Issue 5, p112
line tool, WS-FTP and the Windows-
Commander from the Windows
environment (which no doubt took years
to compile) into KBear 2.0.
Of course you can open connections
manually in the KBearSiteManagerBase
window. To do so, simply select the FTP
server you need, click on Connect , and
you’re up and running. This is useful for
users who prefer a more sophisticated
approach: The protocol option allows you
to select the more secure sftp variant from
the Secure Shell family instead of simple
ftp . You can also click on the Advanced…
button to define additional options, such
as the number of retries, or toggle Passive
Mode (Figure 6) on and off.
Gimme, gimme!
After connecting to one or more FTP
servers there is nothing to stop you
downloading to your heart’s desire. But
connections to multiple servers will tend
to clutter the main KBear window. To
prevent this, you might like to organize
the layout of your windows by selecting
Window / Tile .
If you really want to revert to the
look & feel of more traditional FTP
clients, the Tile vertically option is
probably your best bet. More
horizontally
minded users
can also opt for
tile overlapped
(Figure 7) or tile
non-overlapped .
Everyone else
will just have to
discover their
favorite option
by trial and
error. You can
also use Settings
Figure 7: Multiple servers tiled to give some order to the window
Figure 6: Active or
passive?
Figure 8: Making progress with KBear. The bottom panel is indicating the rate of transfer and the
percentage completed.
72
October 2002
www.linux-magazine.com
591318313.003.png 591318313.004.png 591318313.005.png 591318313.006.png 591318313.007.png
Zgłoś jeśli naruszono regulamin