File mode badly shown in smbclient (want DAHR,---R,---- etc)

Ralf.Strandell at silja.com Ralf.Strandell at silja.com
Thu Dec 27 03:05:02 GMT 2001


> -----Original Message-----
> From: Christopher R. Hertel [mailto:crh at nts.umn.edu]
> Sent: 22. joulukuuta 2001 0:28
> To: rsharpe at ns.aus.com
> Cc: Ralf.Strandell at silja.com; Joel at HammersHome.com;
> samba-technical at lists.samba.org
> Subject: Re: File mode badly shown in smbclient (want DAHR,---R,----
> etc)
> 
> 
> I still claim that making the display string easily parsable 
> is going to 
> be difficult.  It may *seem* easier, but I think that there will be 
> syntactic ambiguities.

Yes. It's a nightmare at first. Varying widths, embedded whitespace,
fields that exist only occasionally... But I belive that it is manageable.
The motivation:

1)
The number and order of date (and size) fields is constant, right?
Contents and lengths might vary, but these fields do not contain
tabs or spaces and these fields are space/tab separated in the output.
If the file mode would always be non-empty then it would be very easy to
remove these parts ( N last fields ) and the remaining part would be the
file name.

2)
Is is also worth noting that there are a few characters that are not valid
in filenames.
<, >, ", / and \
Thus the filename could be:	<filename> or maybe "filename"

3)
Some people have suggested the use of libsmbclient etc. but that is not an
option when I must write a shell script (oh yeah...) to be distributed. 
C++ or Perl would do many things better, but not all (requires compiling,
requires Perl etc).
And there is real use for an application like smbclient. Smbmount or
something like
that would be great (it works only in Linux now, right?) but it does not
make
smbclient unnecessary. We want the freedom of choice :)

4) Let's not brake other programs.
	ls -l could use a new experimental output format...
	or maybe the output format could be set by user?

	Let me choose the output field separator (ascii character/string)
	or the contents to be included.

> 
> Chris -)-----
> 
> > Ralf.Strandell at silja.com wrote:
> > 
> > >
> > >Well, I'm writing an extension to the Big Brother system monitoring
> > >software. People are running it on AIX, HP-UX, UnixWare, 
> UNIX System V,
> > >XENIX, Linux, Solaris and many other systems. And my 
> script must work on
> > >them all. Thus I cannot ship any Smbclient binaries - and 
> it would be very
> > >stupid to start distributing a modified version of 
> "standard software" such
> > >as Smbclient be it source code or binary...
> > >
> > >Where do I reach the developers of Smbclient? I believe 
> that a better
> > >display of the file mode should be a standard feature of 
> that little gem ;)
> > >
> > 
> > Well, you have reached them ... What you want should not be 
> hard ... sounds reasonable as well, however, Amanda already 
> uses smbclient for backup, so there may be some legacy 
> issues. I will try some patches this afternoon.
> > 
> > -- 
> > Richard Sharpe, rsharpe at ns.aus.com, LPIC-1
> > www.samba.org, www.ethereal.com, SAMS Teach Yourself Samba 
> > in 24 Hours, Special Edition, Using Samba
> > 
> > 
> > 
> > 
> 
> 
> -- 
> Christopher R. Hertel -)-----                   University of 
> Minnesota
> crh at nts.umn.edu              Networking and 
> Telecommunications Services
> 
>     Ideals are like stars; you will not succeed in touching them
>     with your hands...you choose them as your guides, and following
>     them you will reach your destiny.  --Carl Schultz
> 




More information about the samba-technical mailing list