Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

SysFileTree on Linux
Using ooRexx on Linux, is there any way to see the hidden files
(ie those with filename starting with .)?
I tried using the 4th parameter (tattrib) but I get an "invalid call to rout
ine"
error.

Report this thread to moderator Post Follow-up to this message
Old Post
Bob Martin
03-27-08 01:19 PM


Re: SysFileTree on Linux
Hi!

I havn't got a Linux available right now to test on, but if you
start  the file mask with a dot you ought to get the hidden files.
Call SysFiletree "/var/.*" ......
but I'm afraid you need another call to get the non-hidden files
Call SysFiletree "/var/*" ......
/dg



"Bob Martin" <bob.martin@excite.com> wrote in message news:QWMGj.17751$Ff4.16729@newsfe5-wi
n.ntli.net...
>
> Using ooRexx on Linux, is there any way to see the hidden files
> (ie those with filename starting with .)?
> I tried using the 4th parameter (tattrib) but I get an "invalid call to ro
utine"
> error.



Report this thread to moderator Post Follow-up to this message
Old Post
Dan van Ginhoven
03-28-08 12:35 AM


Re: SysFileTree on Linux
in 37712 20080327 181551 "Dan van Ginhoven" <danfan46@hotmail.com> wrote:
>Hi!
>
>I havn't got a Linux available right now to test on, but if you
>start  the file mask with a dot you ought to get the hidden files.
>Call SysFiletree "/var/.*" ......
>but I'm afraid you need another call to get the non-hidden files
>Call SysFiletree "/var/*" ......
>/dg

Thanks, that gives the files in the specified directory, but it doesn't get
the directories whose names start with . nor the files in those
directories (I have specified B(oth) and S(ubdirs) in the options field).

Report this thread to moderator Post Follow-up to this message
Old Post
Bob Martin
03-28-08 09:53 AM


Re: SysFileTree on Linux
Bob Martin wrote:
> Using ooRexx on Linux, is there any way to see the hidden files
> (ie those with filename starting with .)?

Indeed there does seem to me to be unexpected results for a SysFileTree for 
*. SysFileTree for '.*' does pick up .* hidden files in the current dir and 
sumdirs under the current dir. Most unfortunate
that it seems necessary to do a double call... once for '*' and again for '.
*'

Was this intentional in the design? (Anyone lurking here that is part of the
 ooRexx dev team?)

--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Report this thread to moderator Post Follow-up to this message
Old Post
Michael Lueck
03-29-08 12:29 AM


Re: SysFileTree on Linux
in 37729 20080328 190901 Michael Lueck <mlueck@lueckdatasystems.com> wrote:
>Bob Martin wrote: 
>
>Indeed there does seem to me to be unexpected results for a SysFileTree for
 *. SysFileTree for '.*'
>does pick up .* hidden files in the current dir and sumdirs under the curre
nt dir. Most unfortunate
>that it seems necessary to do a double call... once for '*' and again for '.*'[/col
or]

It's even worse than that - the S option is ignored so it is necessary to di
ve down through
the subdirectory structure, a directory at a time.

>
>Was this intentional in the design? (Anyone lurking here that is part of th
e ooRexx dev team?)
>
>--
>Michael Lueck
>Lueck Data Systems
>http://www.lueckdatasystems.com/

Report this thread to moderator Post Follow-up to this message
Old Post
Bob Martin
03-29-08 01:15 PM


Re: SysFileTree on Linux
Bob Martin wrote:

> It's even worse than that - the S option is ignored so it is necessary to 
dive down through
> the subdirectory structure, a directory at a time.

I tested searching for '*' and '.*' in my home directory.

I created a .test file in a subdir off of my home dir.

SysFileTree with options FS found the file in the subdir.

Thus I do not see that need to scan each directory. And I tested with ooRexx
 3.2.
 
mdlueck@aleks:~$ ./bin/hiddenfiles.rex|grep bin
3/28/08   3:04p           3  -rw-r--r--  /home/mdlueck/bin/.test
mdlueck@aleks:~$
<<<<<

'da source...

#!/usr/bin/rexx

rc=SysFileTree('.*', f., 'FS')

if f.0>0 then do i=1 to f.0
say f.i
end

exit

--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Report this thread to moderator Post Follow-up to this message
Old Post
Michael Lueck
03-30-08 12:28 AM


Re: SysFileTree on Linux
in 37734 20080329 164557 Michael Lueck <mlueck@lueckdatasystems.com> wrote:
>Bob Martin wrote:
> 
>
>I tested searching for '*' and '.*' in my home directory.
>
>I created a .test file in a subdir off of my home dir.
>
>SysFileTree with options FS found the file in the subdir.
>
>Thus I do not see that need to scan each directory. And I tested with ooRex
x 3.2.
> 
>mdlueck@aleks:~$ ./bin/hiddenfiles.rex|grep bin
>3/28/08   3:04p           3  -rw-r--r--  /home/mdlueck/bin/.test
>mdlueck@aleks:~$
><<<<<
>
>'da source...
>
>#!/usr/bin/rexx
>
>rc=SysFileTree('.*', f., 'FS')
>
>if f.0>0 then do i=1 to f.0
>say f.i
>end
>
>exit
>
>--
>Michael Lueck
>Lueck Data Systems
>http://www.lueckdatasystems.com/


Well, I just checked again.  Ran this :
rc = SysFileTree('~/.*','LIST.','BSL')
and it returned all the files and directories in my home directory with name
s starting
with a dot.  It did not return the contents of any of the directories.


Report this thread to moderator Post Follow-up to this message
Old Post
Bob Martin
03-30-08 10:15 AM


Re: SysFileTree on Linux
Bob Martin wrote:
> Well, I just checked again.  Ran this :
> rc = SysFileTree('~/.*','LIST.','BSL')
> and it returned all the files and directories in my home directory with na
mes starting
> with a dot.  It did not return the contents of any of the directories.

I adjusted first to your filespec, then added the 'BSL'. With both I get...

mdlueck@aleks:/opt$ ~/bin/hiddenfiles.rex|grep bin
2008-03-28 15:04:08           3  -rw-r--r--  /home/mdlueck/bin/.test
mdlueck@aleks:/opt$

I have no idea why you are seeing different results if you are on ooRexx 3.2
.

--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Report this thread to moderator Post Follow-up to this message
Old Post
Michael Lueck
03-30-08 01:24 PM


Re: SysFileTree on Linux
Michael Lueck wrote:
Bob Martin wrote: 

I don't have the original post (it may turn up later).

I've always thought that unless you use simply "*" to search for files
and folders then it only recurses into the folders which *do* match your
search criteria.

So if you specify "a*" it will find all files and folders starting with
"a" then recurse into the folders which start with "a".  I tend always
to use "*" then sort out what I want inside the rexx because of this.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk

Report this thread to moderator Post Follow-up to this message
Old Post
Steve Swift
04-01-08 03:18 AM


Re: SysFileTree on Linux
Steve Swift wrote:
> I've always thought that unless you use simply "*" to search for files
> and folders then it only recurses into the folders which *do* match your
> search criteria.

The OP's question was how to make "hidden" files (Those starting with a peri
od) to show up when doing a SysFileTree for '*'.

I confirmed they do not show up, I must specify '.*' to have those files sho
w up.

The OP's suggested that it was necessary to call SysFileTree for each direct
ory in the tree, however I find that it will pick up hidden files in subdirs
. Thus my question of which version of ooRexx he
was using. I am using ooRexx 3.2.

So, please create some files starting with a period, and we would be interes
ted to hear your test results.

--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Report this thread to moderator Post Follow-up to this message
Old Post
Michael Lueck
04-01-08 03:18 AM


Sponsored Links




Last Thread Next Thread Next
Pages (3): [1] 2 3 »
Search this forum -> 
Post New Thread

Rexx archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 11:17 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.