× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Luis,

Don't be afraid to contradict me. As I mentioned before, I always use the Unix-like tools in QShell, so I may certainly be missing a nuance of RMVDIR.

Here's a quick test that I ran:

> STRQSH

$
> mkdir testrmv
$
> touch testrmv/myfile
$
> rmdir testrmv
rmdir: 001-2140 Error found removing the directory testrmv. Directory not empty.
$

(Exit QShell... back to native env)

> RMVDIR DIR('/home/sklement/testrmv') SUBTREE(*ALL)
2 object links removed. 0 object links not removed.

As you can see... the RMVDIR command removed the directory as well as the file inside it. I tried the same test with multiple subdirs, and put files inside the subdirs, etc... all worked, with SUBTREE(*ALL) it deletes everything inside the dir.

I tried the same test (the first one with a dir containing a single empty file) , but this time I used RMVLNK instead:

> RMVDIR DIR('/home/sklement/testrmv') RMVLNK(*YES)
Directory contains objects. Directory is /home/sklement/testrmv.

So yeah, this did not work (just like you said, Luis) so I looked at the help for it, and it says:

Note: The QDLS, QSYS.LIB and independent ASP QSYS.LIB file
systems support removal of links using this parameter
specification. For all other file systems, use the
SUBTREE(*ALL) parameter specification.

So, apparently, RMVLNK only works in QDLS or QSYS.LIB. That's a very counter-intuitive (and stupid, IMHO) implementation. But, it does match our findings. So I tried it again in the /QDLS filesystem

> RMVDIR DIR('/qdls/testrmv') RMVLNK(*YES)
Directory removed.

Works as expected, there.

Moral of the story: Just use the Unix commands. :-)


On 10/19/2012 7:43 AM, Luis Rodriguez wrote:
Scott,

I'm almost afraid to contradict you :-) but, if I remove the subdirectory,
copy a file to my '/home/test1' folder and try to run RMVLNK again, I get
the same error. What could be I doing wrong here?

On the other hand, I shouldn't be on V5R3 :-( (I use the QSH commands for
this, though).


Regards,

Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.