Re: Using Files Without Mounting A Share From Another System
On Sat, 23 Apr 2011 11:04:20 -0400, Hal Vaughan wrote:
> On Apr 23, 2011, at 6:44 AM, Camaleón wrote:
>>> Does Java handle the SMB protocol on its own? I know I can't list a
>>> directory that way with ls, even with the Samba client package
>> Good question.
>> Nowadays it should handle smb:// or other network protocol just the
>> same it does with http:// but maybe it has auto-imposed some
>> limitations on linux environments (at least under windows you can
>> launch a java JAR that is stored in a network share) or is just the JAR
>> file has to be prepared to be run over the network (IIRC, there is a
>> jCIFS library to that precisely purpose).
> I tried, on the command line in Windows XP, "dir \\server\directory" and
> it works, but SMB/CIFS is built in to Windows. As far as I can tell,
> there is no equivalent on Linux unless you use smbclient. SMB is not
> built into Linux and it seems without smbclient, Linux cannot access an
> SMB share.
> I've been searching, and it looks like there's a CIFS class for Java,
> but it's not built-in to Java and is available at samba.org.
Yep... and it's quite strange.
I still don't know if it's a security measure or just a technical barrier
that needs the use of another applications to be bypassed. In fact, I can
run a ".jar" file over "smb://" using Nautilus but this is what I get:
1/ Jar file is executed but it opens with file roller (archiver utility)
2/ When I try to change file permisson to make it executable I get an
error ("cannot change permissions to file.jar")
All this done over a NTFS volume managed by a Windows host. Maybe a samba
share over a linux filesystem (ext3/4/reiser/xfs...) gives different
results... dunno :-?
> I don't have to use SMB, I could have the server use NFS as well, but I
> can't find anything about reading an NFS share unless it's mounted. As
> best I can tell, unless you use a program like smbclient, scp, ftp, or
> rsync, there is no way to read any network share in Linux unless it's
> mounted. To make a program on a non-local volume available locally, you
> can either copy it to the local computer or mount the share. At least
> that's the best I can find out. It's kind of tough to Google this,
> since searches always turn up tutorials on how to mount a volume.
I can't tell as I've never used NFS shares but maybe is worth a try :-)