NAME ^

src/pmc/file.pmc - File PMC

DESCRIPTION ^

File is a singleton class which provides access to File functions.

Methods ^

void *get_pointer()

void set_pointer(void *ptr)

These two functions are part of the singleton creation interface. For more information see src/pmc.c.

INTVAL is_dir(STRING *path)

Returns a true value (1) if the supplied path is a directory.

INTVAL is_file(STRING *path)

Returns a true value (1) if the supplied path is a plain file.

INTVAL is_link(STRING *path)

Returns a true value (1) if the supplied path is a link.

void copy(STRING *from, STRING *to)

Copy the contents from file represented by path from to the path to.

Uses the "work everywhere method". It is good enough to start with.

NOTE: I'm sure that there should be more efficient ways to do this. Be free to change or give me hints on how to change it. -- ambs

void rename(STRING *from, STRING *to)

Rename a file from to the path to.

SEE ALS0 ^

   stat(2), rename(2)


parrot