?
Solved

Open Folder/File in Linux

Posted on 2009-05-18
5
Medium Priority
?
1,644 Views
Last Modified: 2012-05-07
Hi,

Am trying to open a folder or file on linux(Suse,CentOS)
using the following

dim f as folderitem
f = GetFolderItem("/root/abc.txt") or f = GetFolderItem("/root/bin/myfolder")
f.launch

unfortunately nothing happens ...neither the file nor the folder is launched ...works fine on windows/mac ...
Has anyone else faced this situation?


regards
Pramod
0
Comment
Question by:pramodpatel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 

Author Comment

by:pramodpatel
ID: 24409855
Hi,

Managed to launch folders with the following

dim s as shell
dim g as FolderItem
s = new shell
g=GetFolderItem(EditField1.text)

s.execute( "nautilus /root/bin")


looking to open movie files now...
regards
pramod
0
 
LVL 23

Accepted Solution

by:
Mysidia earned 750 total points
ID: 24417534
In Linux, text files are not normally executable.  If you can ever click on a text file to run it, that's a special attribute of the file manager program you are using to "present a view" of the file.

Instead of launching the file you want to view, you launch a PROGRAM and pass the file you want to open as an argument.
eg

Dim item As FolderItem
item = GetFolderItem("/path/to/kfmclient")
f.launch "exec /path/to/file.txt"

The idea is to run, for example  "/opt/kde3/bin/kfmclient exec /path/to/file.txt"

The GNOME equivalent (for Linux systems using the Gnome WM)  is
gnome-open,  i.e.

Dim item As FolderItem
item = GetFolderItem("/path/to/gnome-open")
f.Launch "/path/to/file.txt"


in XFCE it would be exo-open


In Linux, the user could be utilizing a different window manager, and every WM has a different way of accomplishing this.


KDE and Gnome being the common cases.
0
 

Author Comment

by:pramodpatel
ID: 24418532
hi Mysidia,
firstly..thnx so much for replying... its damn difficult to get answers for realbasic here... :)
i managed to launch the folders yesterday ...also got the files to work ...thnx so much for your replies...

Could you plz also look into my previous question regarding the shell in realbasic?


regards
pramod
0

Featured Post

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question