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

Re: smbclient tab completion




On Monday, Jan 3, 2005, at 14:08 US/Central, Bryan J. Smith wrote:
> I would assume a remote procedure call (RPC) would be required for a
> remote filesystem.
>
> NFS, SMBfs and other user space support for network filesystem kernel
> VFS mounts would provide this.  I assume smbclient does not.
>
> Interesting problem though, one that _might_ have a solution -- if not
> should be a hack to smbclient itself.

I would imagine it wouldn't be that hard.  You don't need to mount the 
FS at all.  Just send a query for the entire folder for the current 
listed directory, cache it (e.g. as a hash), and use the hash as the 
lookup for tab completion.  That's the quick-and-dirty method.  A 
better method would handle changes to the remote FS.

For example:
smb: \> cd
Current directory is \
smb: \> dir t*
   temp                                D        0  Thu Dec 23 11:03:29 
2004
   TMP                                 D        0  Mon May 10 12:52:34 
2004
                 34545 blocks of size 1048576. 5533 blocks available
smb: \> cd t{tab}{tab}       # at this point smbclient sends a 'ls t*', 
caches the results, and displays the choices
temp  TMP
smb: \> cd te{tab}{tab}      # at this point smbclient looks up the 
choices and fills in the result
smb: \> cd temp/

BTW, tab-completion is already built-in to smbclient.  It's just that 
tab-completion only operates on the local system and not on the remote 
system.  It would be nice to have a option that can switch between the 
two.

Just my $0.02.  Not like I would be trying to implement this any time 
soon.

Regards,
- Robert
http://www.cwelug.org/downloads
Help others get OpenSource.  Distribute FLOSS for
Windows, Linux, *BSD, and MacOS X with BitTorrent


-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.