Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unidoc: close the file when done with it #356

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ help:
@echo " sh configure --build=x86_64-w64-mingw32"
@echo " make"
@echo
@echo " The --help option of configure gives details of build options"

##################################################################
#
Expand Down
12 changes: 3 additions & 9 deletions uni/unidoc/UniFile.icn
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,6 @@ class UniFile : Object (iKeySet, uKeySet, oldTokens, buffer, line, fName,
return buffer := s
end

# <p>
# Close this file.
# </p>
method close()
write("This method is no longer used")
end

# <p>
# Is a word a keyword?
Expand Down Expand Up @@ -341,18 +335,18 @@ class UniFile : Object (iKeySet, uKeySet, oldTokens, buffer, line, fName,
}
end

method getFromFile(f)
method readFile(f)
cBuf := CodeBuf()
while line := read(f) do cBuf.add(line)
close(f)
end

# <b>Fails if cannot open <tt>fName</tt> for reading.</b>
initially (fileName, path)
/path := ""
fName := delSuffix(fileName,".icn")||".icn"
f := open(path||fName) | fail
getFromFile(f)
readFile(f)
close(f)
clearBuffer()
line := ""
# the only keywords we care about, everything else is noise...
Expand Down