<html><body>Hi Joerg,<div><br></div><div>Thank you. Based on your example, I coded this module, it has this toolbox</div><div><br></div><div>Dir.List - enumerate directory with sectors</div><div>Dir.Find - find files by secs, and dump their names in dec</div><div>Dir.Delete - delete files by secs</div><div><br></div><div>It is interesting that file with a strange header, had the byte 255 in the place of dot '.'</div><div>Dir.Delete seems to have removed it.</div><div><br></div><div>--------------------------------------------------------------------------------------------------</div><div><br></div><div><div>MODULE Dir; (*TK 24.3.2017*)</div><div> IMPORT Texts, FileDir, Oberon;</div><div> VAR W: Texts.Writer; fsec: INTEGER;</div><div><br></div><div> PROCEDURE ListSec(name: FileDir.FileName; sec : INTEGER; VAR cont: BOOLEAN);</div><div> BEGIN</div><div> Texts.WriteString(W, name); Texts.WriteString(W, " ");</div><div> Texts.WriteInt(W, sec, 6);</div><div> Texts.WriteLn(W);</div><div> cont := TRUE</div><div> END ListSec;</div><div><br></div><div> PROCEDURE FindSec(name: FileDir.FileName; sec : INTEGER; VAR cont: BOOLEAN);</div><div> VAR i: INTEGER; ch: BYTE;</div><div> BEGIN</div><div> IF fsec = sec THEN cont := FALSE; </div><div> Texts.WriteString(W, name); Texts.WriteString(W, " ");</div><div> i := 0; REPEAT ch := ORD(name[i]); Texts.WriteInt(W, ch, 4); INC(i); UNTIL ch = 0;</div><div> Texts.WriteInt(W, sec, 6);</div><div> Texts.WriteLn(W);</div><div> ELSE cont := TRUE </div><div> END</div><div> END FindSec;</div><div><br></div><div> PROCEDURE DelSec(name: FileDir.FileName; sec : INTEGER; VAR cont: BOOLEAN);</div><div> BEGIN</div><div> IF fsec = sec THEN cont := FALSE; </div><div> Texts.WriteString(W, name); Texts.WriteInt(W, sec, 6); Texts.WriteString(W, " deleting");</div><div> FileDir.Delete(name, sec);</div><div> Texts.WriteLn(W);</div><div> ELSE cont := TRUE </div><div> END</div><div> END DelSec;</div><div><br></div><div> PROCEDURE List*;</div><div> BEGIN </div><div> FileDir.Enumerate("", ListSec); Texts.Append(Oberon.Log, W.buf)</div><div> END List;</div><div><br></div><div> PROCEDURE Find*;</div><div> VAR S: Texts.Scanner;</div><div> BEGIN</div><div> Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S);</div><div> WHILE S.class = Texts.Int DO fsec := S.i; </div><div> FileDir.Enumerate("", FindSec); Texts.Append(Oberon.Log, W.buf); Texts.Scan(S)</div><div> END</div><div> END Find;</div><div><br></div><div> PROCEDURE Delete*;</div><div> VAR S: Texts.Scanner;</div><div> BEGIN</div><div> Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S);</div><div> WHILE S.class = Texts.Int DO fsec := S.i; </div><div> FileDir.Enumerate("", DelSec); Texts.Append(Oberon.Log, W.buf); Texts.Scan(S)</div><div> END</div><div> END Delete;</div><div><br></div><div>BEGIN Texts.OpenWriter(W)</div><div>END Dir.</div></div><div><br></div><div><br></div><div><br></div><div><br><p>---------- Původní zpráva ----------<br>Od: Jörg <joerg.straube@iaeth.ch><br>Komu: ETH Oberon and related systems <oberon@lists.inf.ethz.ch><br>Datum: 23. 3. 2017 10:16:43<br>Předmět: Re: [Oberon] FPGA Oberon - Lost file reclaim storage</p><br><blockquote><div dir="auto"><div>Yes, it's indeed a recursive directory traverse.</div><div>If you have found your strange file (by checking "name") a call to FileDir.Delete(name, sec) should do. After the delete set cont := FALSE and the recursion will stop.</div><div><br>Jörg</div><div><br></div><div>BTW: my code was already Oberon-7 :-) The first thing I did is I compiled the rather portable module Out.Mod as its main task is to simplify writing to Oberon.Log...</div><div><a href="https://github.com/Spirit-of-Oberon/ETH-Oberon-PlugIn-Win32/blob/master/Src/Out.Mod.txt">https://github.com/Spirit-of-Oberon/ETH-Oberon-PlugIn-Win32/blob/master/Src/Out.Mod.txt</a><br><div><br><br></div>Am 22.03.2017 um 19:14 schrieb <<a href="mailto:thomas.kral@email.cz">thomas.kral@email.cz</a>> <<a href="mailto:thomas.kral@email.cz">thomas.kral@email.cz</a>>:<br><br></div><blockquote><div>Hi Joerg,<div><br></div><div>Interesting, is this a recursive directory traverse?</div><div>It indeed reports one the files in question and its sector(start?) number.</div><div><br></div><div>Tomas</div><div><br></div><div>---</div><div><br></div><div>Recoded for revised FPGA (V7?) Oberon as below, still struggling a bit with terminology. </div><div><br></div><div><div>MODULE MyDir;</div><div> IMPORT Texts, FileDir, Oberon;</div><div> VAR W: Texts.Writer;</div><div><br></div><div> PROCEDURE List(name: FileDir.FileName; sec : INTEGER; VAR cont: BOOLEAN);</div><div> BEGIN</div><div> Texts.WriteString(W, name); Texts.WriteInt(W, sec, 6);</div><div> Texts.WriteLn(W);</div><div> cont := TRUE</div><div> END List;</div><div> </div><div> PROCEDURE Do*;</div><div> BEGIN </div><div> FileDir.Enumerate("", List); Texts.Append(Oberon.Log, W.buf)</div><div> END Do;</div><div><br></div><div>BEGIN Texts.OpenWriter(W);</div><div>END MyDir.</div></div><div><br><p>---------- Původní zpráva ----------<br>Od: Jörg <<a href="mailto:joerg.straube@iaeth.ch">joerg.straube@iaeth.ch</a>><br>Komu: 'ETH Oberon and related systems' <<a href="mailto:oberon@lists.inf.ethz.ch">oberon@lists.inf.ethz.ch</a>><br>Datum: 22. 3. 2017 18:04:00<br>Předmět: Re: [Oberon] FPGA Oberon - Lost file reclaim storage</p><br><blockquote><div lang="DE-CH"><div><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US">Thomas</span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US"> </span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US">Can you still enumerate the corrupted file?</span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US">I mean, will this program find your file?</span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US"> </span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US">MODULE myDir</span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US"> </span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US">IMPORT FileDir, Out;</span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US"> </span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US">PROCEUDRE List(name: FileDir.FileName; sec: INTEGER; VAR cont: BOOLEAN);</span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US"> BEGIN</span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US"> Out.String(name); Out.Int(sec, 12); Out.Ln;</span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US"> cont := TRUE</span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US"> END List;</span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US"> </span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US">PROCEDURE Do*;</span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US"> BEGIN</span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US"> FileDir.Enumerate(“”, List)</span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US"> END Do;</span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US">BEGIN</span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US">END myDir.Do</span></font></p><p><font size="2" face="Arial"><span lang="EN-US" style="font-size:11pt;font-family:'Arial',sans-serif;mso-fareast-language:EN-US"> </span></font></p><p><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12pt;mso-fareast-language:EN-US"> </span></font></p><div><div style="border:none;border-top:solid #E1E1E1 1pt;padding:3pt 0cm 0cm 0cm"><p><b><font size="2" face="Calibri"><span lang="EN-US" style="font-size:11pt;font-family:'Calibri',sans-serif;font-weight:bold">From:</span></font></b><font size="2" face="Calibri"><span lang="EN-US" style="font-size:11pt;font-family:'Calibri',sans-serif"> Oberon [<a href="mailto:oberon-bounces@lists.inf.ethz.ch">mailto:oberon-bounces@lists.inf.ethz.ch</a>] <b><span style="font-weight:bold">On Behalf Of </span></b><a href="mailto:thomas.kral@email.cz">thomas.kral@email.cz</a><br><b><span style="font-weight:bold">Sent:</span></b> Dienstag, 21. März 2017 09:53<br><b><span style="font-weight:bold">To:</span></b> ETH Oberon and related systems <<a href="mailto:oberon@lists.inf.ethz.ch">oberon@lists.inf.ethz.ch</a>><br><b><span style="font-weight:bold">Subject:</span></b> [Oberon] FPGA Oberon - Lost file reclaim storage</span></font></p></div></div><p><font size="3" face="Times New Roman"><span style="font-size:12pt"> </span></font></p><p><font size="3" face="Times New Roman"><span style="font-size:12pt">Hi,</span></font></p><div><p><font size="3" face="Times New Roman"><span style="font-size:12pt"> </span></font></p></div><div><p><font size="3" face="Times New Roman"><span style="font-size:12pt">On a very rare occasion, I happened to produce a file that has a corrupt header, wherby a dot '.' in its name is replaced by an invisible character.</span></font></p></div><div><p><font size="3" face="Times New Roman"><span style="font-size:12pt"> </span></font></p></div><div><p><font size="3" face="Times New Roman"><span style="font-size:12pt">Subsequent writing to the same file name resolved the situation and file was created normally. </span></font></p></div><div><p><font size="3" face="Times New Roman"><span style="font-size:12pt"> </span></font></p></div><div><p><font size="3" face="Times New Roman"><span style="font-size:12pt">Now I am just thinking how I can reclaim the storage taken up by that lost file. Delete on its name fails, as the system does not see it as a regular file. </span></font></p></div><div><p><font size="3" face="Times New Roman"><span style="font-size:12pt"> </span></font></p></div><div><p><font size="3" face="Times New Roman"><span style="font-size:12pt">Tomas</span></font></p></div></div></div>--
<br><a href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems
<br><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a>
<br></blockquote></div></div></blockquote><blockquote><div><span>--</span><br><span><a href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems</span><br><span><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a></span><br></div></blockquote></div>--
<br>Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems
<br>https://lists.inf.ethz.ch/mailman/listinfo/oberon
<br></blockquote></div></body></html>