CS318 - Pintos
Pintos source browser for JHU CS318 course
Functions
ls.c File Reference
#include <syscall.h>
#include <stdio.h>
#include <string.h>
Include dependency graph for ls.c:

Go to the source code of this file.

Functions

static bool list_dir (const char *dir, bool verbose)
 ls.c More...
 
int main (int argc, char *argv[])
 

Function Documentation

◆ list_dir()

static bool list_dir ( const char *  dir,
bool  verbose 
)
static

ls.c

Lists the contents of the directory or directories named on the command line, or of the current directory if none are named.

By default, only the name of each file is printed. If "-l" is given as the first argument, the type, size, and inumber of each file is also printed. This won't work until project 4.

Definition at line 16 of file ls.c.

References close(), filesize(), inumber(), isdir(), name, open(), printf(), readdir(), READDIR_MAX_LEN, and snprintf().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int argc   ,
char *  argv[] 
)

Definition at line 68 of file ls.c.

References EXIT_FAILURE, EXIT_SUCCESS, list_dir(), and strcmp().

Here is the call graph for this function: