Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Unable to open files containing a space character [solved]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
GOS
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2010
Posts: 102
Location: Germany

PostPosted: Mon Jun 21, 2021 12:10 pm    Post subject: Unable to open files containing a space character [solved] Reply with quote

Hello,

I have the following problem:

If I try to open a file containing a space character, some programs fail while others work as expected.

E.g. I double-click on a file named "/home/user/The Test.abc" then evince, libreoffice, mousepad, firefox an some others fail. They say that they cannot find the files "The" and "Test.abc".

On the other hand programs like Gimp or MuPdf open "The Test.abc" as expected.

Interestingly the problem is the same if I try to open "The Test.abc" via command like (Xfce-Terminal). MuPdf and Gimp work while evince, libreoffice, mousepad and firefox do not.

Any Ideas?!?

PS: I know that spaces in file-names are odd and I do not use them by myself, but unfortunately many e-mails contain attachments with spaces and the problem prevents to open them quickly.


Last edited by GOS on Sat Jul 03, 2021 6:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Mon Jun 21, 2021 12:37 pm    Post subject: Re: Unable to open files containing a space character Reply with quote

GOS wrote:
Interestingly the problem is the same if I try to open "The Test.abc" via command like (Xfce-Terminal). MuPdf and Gimp work while evince, libreoffice, mousepad and firefox do not.

First of all: I often work with files which have spaces in their names - and I don't have the problems you posted. Furthermore
Code:
libreoffice "Test with spaces.odt"

works as expected on my machine.

Either your file "The Test.abc" contains a character that looks like a space, but isn't a space - or your machine is configured in a way that spaces in filenames are interpreted as end-of-word characters.

Which shell do you use? Please post the output of "emerge --info".

Do you modify any shell options or modes in your .bashrc or .profile?
Back to top
View user's profile Send private message
GOS
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2010
Posts: 102
Location: Germany

PostPosted: Mon Jun 21, 2021 1:57 pm    Post subject: Reply with quote

/bin/sh points to /bin/bash

The output of emerge info is:

Code:
Portage 3.0.20 (python 3.9.5-final-0, default/linux/amd64/17.1/hardened, gcc-10.3.0, glibc-2.33, 5.4.109-gentoo x86_64)
=================================================================
System uname: Linux-5.4.109-gentoo-x86_64-Intel-R-_Core-TM-_i5-4670T_CPU_@_2.30GHz-with-glibc2.33
KiB Mem:     8142784 total,   6335656 free
KiB Swap:   26214396 total,  26214396 free
Head commit of repository gentoo: 2165aeaeb5da99007497d355546b7f326ee4cb1b

sh bash 5.1_p8
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2
ccache version 4.3 [disabled]
app-shells/bash:          5.1_p8::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.32.1::gentoo
dev-lang/python:          3.8.10_p2::gentoo, 3.9.5_p2::gentoo
dev-lang/rust:            1.52.1::gentoo
dev-util/ccache:          4.3::gentoo
dev-util/cmake:           3.18.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.16.3-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            10.3.0::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33::gentoo
Repositories:

gentoo
    location: /usr/portage/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts:
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo  ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo  ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo  ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo"
LANG="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de de@1901"
MAKEOPTS="-j5"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 apparmor audiofile bash-completion branding bzip2 cairo cdparanoia cleartype corefonts crypt css cups curl cvs dbus dga djvu dri drm dts elogind encode exif fam ffmpeg flac fontconfig foomaticdb ftp fuse gd gif git gnutls gs gstreamer gtk hardened iconv idn imagemagick imap java javascript jbig jpeg ladspa lame lash lcms libglvnd libnotify libsamplerate libtirpc mad matroska midi mikmod mime mng mozilla mp3 mp4 mpeg multilib musepack nas ncurses nls nptl ogg openexr opengl openmp osc pam pango pcre pdf php pie plotutils png policykit postscript quicktime readline sdl seccomp session shorten slp sndfile snmp sockets socks5 sound sox speex spell split-usr ssl ssp startup-notification subversion svg szip taglib tcpd theora threads thunar tiff timidity truetype type3 udev udisks unicode usb v4l vcd vorbis wavpack wmf x264 xattr xcb xcomposite xfce xinetd xml xmp xorg xpm xtpax xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" L10N="de de-1901" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="vmware" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21633

PostPosted: Mon Jun 21, 2021 6:50 pm    Post subject: Reply with quote

What do you mean when you open "via command like"? You ran firefox 'The Test.abc', exactly as written, including the single quotes, and Firefox failed to find the file?

When you open by double-click, how does your GUI tool know what program to run?
Back to top
View user's profile Send private message
GOS
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2010
Posts: 102
Location: Germany

PostPosted: Sat Jul 03, 2021 6:50 pm    Post subject: Reply with quote

Thanks for your help. Found the problem. I call some binaries through a skript in /usr/local/bin (e.g. firefox) and here I used $@ instead of "$@".

Now the problem is solved.

Mike's question which shell I use was a good hint.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum