Solved

Open Folder/File in Linux

Posted on 2009-05-18
5
1,604 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
  • 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 250 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Xymon customize http timeout 2 84
nagios 4 php error after installation 6 90
expectj telnet failing 5 35
how to print sub line with  sed /awk /perl in bash file 11 22
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

816 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now