[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using Files Without Mounting A Share From Another System



On Apr 23, 2011, at 6:44 AM, Camaleón wrote:

> On Fri, 22 Apr 2011 15:42:56 -0400, Hal Vaughan wrote:
> 
>> On Apr 22, 2011, at 1:56 PM, Camaleón wrote:
>> 
>>> On Fri, 22 Apr 2011 13:03:00 -0400, Hal Vaughan wrote:
>>> 
>>> (...)
>>> 
>>>> I need a way, on Linux, to access files on a network share, which
>>>> could be SMB or NFS (or something else) without mounting the volume. 
>>>> For example, if I'm on System A and I have an executable on System B,
>>>> and it's on a network share on System B, is there any way to run that
>>>> executable without mounting that share as a volume on System A?
>>> 
>>> Hum... I think it could be possible, just ensure that the file in the
>>> share has the proper rights (that is, it should be executable by the
>>> user).
>>> 
>>> As for java files, you could create a launcher on the desktop pointing
>>> to the file:
>>> 
>>> java -jar smb://path/to/jar/file.jar
>> 
>> 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
>> installed.
> 
> 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.

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.



Hal

Reply to: