Code Comments
Programming Forum and web based access to our favorite programming groups.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.
Post Follow-up to this messageHi! 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.
Post Follow-up to this messagein 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).
Post Follow-up to this messageBob 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/
Post Follow-up to this messagein 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/
Post Follow-up to this messageBob 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/
Post Follow-up to this messagein 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.
Post Follow-up to this messageBob 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/
Post Follow-up to this messageMichael 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
Post Follow-up to this messageSteve 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/
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.