Page 1 of 1

"Find" crashes with blanks in directory name + wish

Posted: Thu Oct 20, 2011 8:28 am
by JosDuchIt
1) crash
I am using a SAM440ep with OS4.1 update 3, but the problem probably is more general

While trying to write a gui for FIND i noticed crashes when blanks are present in the searched directory name

The same crash & grimreaper crashlog appear when you use the OS4 Gui for find or write the find command from shell

Find "Amiga OS4:Documentation" CONTENTS FIND

After the "kill" of the process a rmessage appears:

DOS resource tracker has detected
an unfreed resource while deallocating a DOS process
Process: "Find- Search Process"
Function "ReleaseDirContext() tracker

The problem appears right after boot, no other applications running. Here it is very reproducable
Can this be confirmed?
Is this a known bug ?

2)wish

The shell output gives the name of the files but there are no quotes around it, making it difficult or impossible to parse the output and extract the filename

Re: "Find" crashes with blanks in directory name + wish

Posted: Thu Oct 20, 2011 3:44 pm
by xenic
@JosDuchIt
I can confirm your crash but I don't think it has anything to do with spaces in the directory name. My system partition is labeled "OS4" with no spaces. Entering "Find OS4:Documentation CONTENTS FIND" in a shell crashes on my system. When I noticed that it's crashing while searching the "DH0:Documentation/MiniGL/demos" directory, I copied the MiniGL directory to ram: and did the same search. It crashes when the MiniGL directory is in ram: too. This problem appears to be easily reproducible so hopefully one of the devs or beta testers can confirm and add it to the bug list.
EDIT: I'm using a SAM Flex 800Mhz in case that makes any difference.

Re: "Find" crashes with blanks in directory name + wish

Posted: Thu Oct 20, 2011 4:16 pm
by xenic
@JosDuchit
The shell output gives the name of the files but there are no quotes around it, making it difficult or impossible to parse the output and extract the filename
Using the NOSIZES & NODATES arguments seems to get path+filename only. I tried the LFORMAT option but it doesn't appear to work like the "List" LFORMAT argument. It ignores the percent sign (%) like it did when you tried it as a wildcard in your post at Amigans.net. As a system utility, "FInd" operation should be constistant with other system commands. Since you were searching for the word "FIND" in your example that crashes, I assume that you are looking for some documentation for the Find command too. I even searched the system documentation that came with OS 3.5 and OS 3.9 and found nothing. I think the FInd command needs some repair and docs for the next update or release.

EDIT: Although the %s substitution doesn't appear to work with the Find LFORMAT argument like it does in the List command, I did get the %n substitution to work. Try something like: find DH0:MUI/docs CONTENTS graphical LFORMAT "Name is %n"

Re: "Find" crashes with blanks in directory name + wish

Posted: Thu Oct 20, 2011 7:05 pm
by JosDuchIt
@xenic
The find command is described here
http://www.titan.co.nz/amigaak/AA020844e46.htm
according to the author the LFORMAT just affects the date.

I don't know where he got his info but having tried a number of them i can confirm, that it does not seem to work according to this explanation. I mostly get a number of lines just showing one character (N when using %N)

testing more

find NAME a LFORMAT " %n %p %b %c %d %t"
gives me
%n filename
%p path
%b protection bits
%c comments
%d date
%t time

I started another thread on Find's "non-standard" pattern recognition
http://www.amigans.net/modules/xforum/v ... 6&forum=25

Re: "Find" crashes with blanks in directory name + wish

Posted: Mon Oct 31, 2011 6:29 am
by tonyw
I just tried Xenic's suggested command and got no crash:

>find MUI/docs CONTENTS graphical LFORMAT "Name is %n"
Name is ChangeLog-OS4
Name is MUI.guide

... so it seems OK to me.