Note
All functions in the fs module except for the FSEvent and FSPoll classes support both synchronous and asynchronous modes. If you want to run it synchronous don’t pass any callable as the callback argument, else it will run asynchronously. If the async form is used, then a FSRequest is returned when calling the functions, which has a cancel() method that can be called in order to cancel the request, in case it hasn’t run yet.
Note
All functions that take a file descriptor argument must get the file descriptor resulting of a pyuv.fs.open call on Windows, else the operation will fail. This limitation doesn’t apply to Unix systems.
Parameters: |
|
---|
stat syscall.
Callback signature: callback(loop, path, stat_result, errorno)
Same as pyuv.fs.stat() but it also follows symlinks.
Same as pyuv.fs.stat() but using a file-descriptor instead of the path.
Parameters: |
|
---|
Remove the specified file.
Callback signature: callback(loop, path, errorno)
Parameters: |
|
---|
Create the specified directory.
Callback signature: callback(loop, path, errorno)
Parameters: |
|
---|
Remove the specified directory.
Callback signature: callback(loop, path, errorno)
Parameters: |
|
---|
Rename file.
Callback signature: callback(loop, path, errorno)
Parameters: |
|
---|
Remove the specified directory.
Callback signature: callback(loop, path, errorno)
Same as pyuv.fs.chmod() but using a file-descriptor instead of the path.
Parameters: |
|
---|
Create a hard-link.
Callback signature: callback(loop, path, errorno)
Parameters: |
|
---|
Create a symlink.
Callback signature: callback(loop, path, errorno)
Parameters: |
|
---|
Read link file and return the original file path.
Callback signature: callback(loop, path, errorno)
Parameters: |
|
---|
Changes ownership of a file.
Callback signature: callback(loop, path, errorno)
Same as pyuv.fs.chown() but using a file-descriptor instead of the path.
Parameters: |
|
---|
Open file.
Callback signature: callback(loop, path, fd, errorno)
Parameters: |
|
---|
Close file.
Callback signature: callback(loop, path, errorno)
Parameters: |
|
---|
Read from file.
Callback signature: callback(loop, path, read_data, errorno)
Parameters: |
|
---|
Write to file.
Callback signature: callback(loop, path, bytes_written, errorno)
Parameters: |
|
---|
Sync all changes made to file.
Callback signature: callback(loop, path, errorno)
Parameters: |
|
---|
Sync data changes made to file.
Callback signature: callback(loop, path, errorno)
Parameters: |
|
---|
Truncate the contents of a file to the specified offset.
Callback signature: callback(loop, path, errorno)
Parameters: |
|
---|
List files from a directory.
Callback signature: callback(loop, path, files, errorno)
Parameters: |
|
---|
Send a regular file to a stream socket.
Callback signature: callback(loop, path, bytes_written, errorno)
Parameters: |
|
---|
Update file times.
Callback signature: callback(loop, path, files, errorno)
Same as pyuv.fs.utime() but using a file-descriptor instead of the path.
Parameters: |
|
---|
FSEvent handles monitor a given path for changes.
Callback signature: callback(fsevent_handle, filename, events, error).
Parameters: | callback (callable) – Function that will be called after the FSEvent handle is closed. |
---|
Close the FSEvent handle. After a handle has been closed no other operations can be performed on it.
Callback signature: callback(fsevent_handle).
Read only
Filename being monitored.
Read only
Indicates if this handle is active.
Read only
Indicates if this handle is closing or already closed.
Parameters: | loop (Loop) – loop object where this handle runs (accessible through FSPoll.loop). |
---|
FSPoll handles monitor a given path for changes by using stat syscalls.
Parameters: |
|
---|
Start the FSPoll handle.
Callback signature: callback(fspoll_handle, prev_stat, curr_stat, error).
Parameters: | callback (callable) – Function that will be called after the FSPoll handle is closed. |
---|
Close the FSPoll handle. After a handle has been closed no other operations can be performed on it.
Callback signature: callback(fspoll_handle).
Read only
Indicates if this handle is active.
Read only
Indicates if this handle is closing or already closed.
Module constants