Solved

Open Folder/File in Linux

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

CocoaPods is the best way to manage library dependencies in iOS and OS X projects. By using cocoa pods there is no need of downloading the code from github and copying to your project. There are plenty of open source libraries now available with C…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

9 Experts available now in Live!

Get 1:1 Help Now