Solved

Open Folder/File in Linux

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 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