dev: fix 'navigate' tester
This commit is contained in:
parent
898162121d
commit
ee94d85a8c
1 changed files with 4 additions and 5 deletions
|
@ -409,6 +409,7 @@ navigate:
|
|||
dirent *dir_in;
|
||||
do {
|
||||
dir_in = readdir(dir);
|
||||
if (dir_in)
|
||||
cout << "> " << dir_in->d_name << endl;
|
||||
} while (dir_in);
|
||||
closedir(dir);
|
||||
|
@ -424,14 +425,12 @@ navigate:
|
|||
cout << "Content:" << endl;
|
||||
int n = 1;
|
||||
char buf[1000];
|
||||
while (n)
|
||||
while (n > 0)
|
||||
{
|
||||
n = read(file, buf, 1000);
|
||||
if (n < 0)
|
||||
{
|
||||
cout << "read() error :(" << endl;
|
||||
}
|
||||
if (n > 0)
|
||||
else if (n > 0)
|
||||
write(1, buf, n);
|
||||
}
|
||||
cout << "[EOF]" << endl;
|
||||
|
|
Loading…
Add table
Reference in a new issue