[Oberon] FPGA Oberon - Lost file reclaim storage
Jörg
joerg.straube at iaeth.ch
Thu Mar 23 07:59:50 CET 2017
Yes, it's indeed a recursive directory traverse.
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.
Jörg
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...
https://github.com/Spirit-of-Oberon/ETH-Oberon-PlugIn-Win32/blob/master/Src/Out.Mod.txt
> Am 22.03.2017 um 19:14 schrieb <thomas.kral at email.cz> <thomas.kral at email.cz>:
>
> Hi Joerg,
>
> Interesting, is this a recursive directory traverse?
> It indeed reports one the files in question and its sector(start?) number.
>
> Tomas
>
> ---
>
> Recoded for revised FPGA (V7?) Oberon as below, still struggling a bit with terminology.
>
> MODULE MyDir;
> IMPORT Texts, FileDir, Oberon;
> VAR W: Texts.Writer;
>
> PROCEDURE List(name: FileDir.FileName; sec : INTEGER; VAR cont: BOOLEAN);
> BEGIN
> Texts.WriteString(W, name); Texts.WriteInt(W, sec, 6);
> Texts.WriteLn(W);
> cont := TRUE
> END List;
>
> PROCEDURE Do*;
> BEGIN
> FileDir.Enumerate("", List); Texts.Append(Oberon.Log, W.buf)
> END Do;
>
> BEGIN Texts.OpenWriter(W);
> END MyDir.
>
> ---------- Původní zpráva ----------
> Od: Jörg <joerg.straube at iaeth.ch>
> Komu: 'ETH Oberon and related systems' <oberon at lists.inf.ethz.ch>
> Datum: 22. 3. 2017 18:04:00
> Předmět: Re: [Oberon] FPGA Oberon - Lost file reclaim storage
>
>
> Thomas
>
>
>
> Can you still enumerate the corrupted file?
>
> I mean, will this program find your file?
>
>
>
> MODULE myDir
>
>
>
> IMPORT FileDir, Out;
>
>
>
> PROCEUDRE List(name: FileDir.FileName; sec: INTEGER; VAR cont: BOOLEAN);
>
> BEGIN
>
> Out.String(name); Out.Int(sec, 12); Out.Ln;
>
> cont := TRUE
>
> END List;
>
>
>
> PROCEDURE Do*;
>
> BEGIN
>
> FileDir.Enumerate(“”, List)
>
> END Do;
>
> BEGIN
>
> END myDir.Do
>
>
>
>
>
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of thomas.kral at email.cz
> Sent: Dienstag, 21. März 2017 09:53
> To: ETH Oberon and related systems <oberon at lists.inf.ethz.ch>
> Subject: [Oberon] FPGA Oberon - Lost file reclaim storage
>
>
>
> Hi,
>
>
>
> 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.
>
>
>
> Subsequent writing to the same file name resolved the situation and file was created normally.
>
>
>
> 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.
>
>
>
> Tomas
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20170323/4e626b48/attachment.html>
More information about the Oberon
mailing list