Compare commits
2 commits
5d5e1f77e8
...
ea025be08b
| Author | SHA1 | Date | |
|---|---|---|---|
| ea025be08b | |||
| 86b50b1329 |
2 changed files with 9 additions and 1 deletions
|
|
@ -808,6 +808,11 @@ pub fn file_modified(self: *Self, file_path: []const u8) void {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn file_renamed(self: *Self, from_path: []const u8, to_path: []const u8) OutOfMemoryError!void {
|
pub fn file_renamed(self: *Self, from_path: []const u8, to_path: []const u8) OutOfMemoryError!void {
|
||||||
|
for (self.files.items) |*file| {
|
||||||
|
if (!std.mem.eql(u8, file.path, to_path)) continue;
|
||||||
|
self.file_deleted(from_path);
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (self.files.items) |*file| {
|
for (self.files.items) |*file| {
|
||||||
if (!std.mem.eql(u8, file.path, from_path)) continue;
|
if (!std.mem.eql(u8, file.path, from_path)) continue;
|
||||||
const new_path = try self.allocator.dupe(u8, to_path);
|
const new_path = try self.allocator.dupe(u8, to_path);
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,10 @@ const INotifyBackend = struct {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_read_ready(self: *@This(), allocator: std.mem.Allocator, parent: tp.pid_ref) (std.posix.ReadError || error{ NoSpaceLeft, OutOfMemory, Exit })!void {
|
fn handle_read_ready(self: *@This(), allocator: std.mem.Allocator, parent: tp.pid_ref) (std.posix.ReadError || error{ ThespianFileDescriptorWaitReadFailed, NoSpaceLeft, OutOfMemory, Exit })!void {
|
||||||
|
// re-arm the file_discriptor
|
||||||
|
try self.fd_watcher.wait_read();
|
||||||
|
|
||||||
const InotifyEvent = extern struct {
|
const InotifyEvent = extern struct {
|
||||||
wd: i32,
|
wd: i32,
|
||||||
mask: u32,
|
mask: u32,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue