File

Module for parsing file management

Example

rps install file

Actions

append-to-file :: String → String → void

Parameters:
Name Type Description
filepath string

path to be read from

content string

The content to append to

Returns:
void

delete-file :: String → void

Parameters:
Name Type Description
filepath string

path to be read from

Returns:
void

file-exists :: String → Boolean

Parameters:
Name Type Description
filepath string

path to check if exists

Returns:
boolean
Example
write-file 'file.txt' ''
;Print out true
log file-exists 'file.txt'
delete-file 'file.txt'
;Print out false
log file-exists 'file.txt'

file-stat :: String → fs.Stats

provide the stats of the file

Parameters:
Name Type Description
filepath string
Returns:
Stats
Example
file-stat 'file.txt'
log $RESULT

read-file :: String → String

Parameters:
Name Type Description
filepath string

path to be read from

Returns:
  • string -

    read-file 'file.txt'

  • string

rename-file :: String → String → void

rename the current file

Parameters:
Name Type Description
oldpath string

file to be changed

newpath string

new path of the file

Returns:
void
Example
rename-file 'file.txt' 'name.txt'
log file-exists 'name.txt'

write-file :: String → String → void

Parameters:
Name Type Description
filepath string

path to be read from

content string

The content to write

Returns:
void
-->