Skip to content

Commit

Permalink
Merge pull request #565 from paulscottrobson/dirstat
Browse files Browse the repository at this point in the history
Fixed emulator stat directory bug
  • Loading branch information
paulscottrobson authored Aug 6, 2024
2 parents af1522b + 6629a7f commit df2f964
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
27 changes: 15 additions & 12 deletions basic/test.bsc
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
open output 1,"test.txt"
a$ = "Line 2"
print line #1,"Hello world!",a$
print line #1,"Line 3",""
close 1
f$ = "test.xxx"
f$ = "testdir2"
fName = $D000
poke fName,len(f$)
for i = 1 to len(f$):poke fname+i,asc(mid$(f$,i)):next

open input 1,"test.txt"
print eof(1)
while eof(1) = 0
input line #1,a$
print "[";a$;"]"
wend
close 1
while peek($FF00):wend
doke $FF04,$D000
poke $FF01,16
poke $FF00,3
while peek($FF00):wend

result = peek($FF02)
size = deek($FF04)
attrib = peek($FF08)
print result,size,attrib
Binary file added documents/sound.ods
Binary file not shown.
4 changes: 3 additions & 1 deletion emulator/src/core/hardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ uint8_t FISStatFile(const std::string& filename, uint32_t* length, uint8_t* attr
printf("FISStatFile('%s') -> ", abspath.c_str());

try {
*length = std::filesystem::file_size(abspath);
if (!std::filesystem::is_directory(abspath)) {
*length = std::filesystem::file_size(abspath);
}
*attribs = getAttributes(abspath);
printf("OK; length=0x%04x; permissions=0x%02x\n", *length, *attribs);
return 0;
Expand Down

0 comments on commit df2f964

Please sign in to comment.