removeWatc...tRecursive(3)

📦 version 3.0.1.4, in arch rolling, ubuntu resolute, ubuntu stonking

✨ NAME ✨

removeWatchTargetRecursive — 从监听列表中移除指定的文件

Okay so real talk, that's the original Chinese one-liner and it means "remove the specified file from the listening list" 🎀 — she takes a file you were watching and yeets it off the guest list. That's the whole job. Simple. Iconic. No notes.


🌸 SYNOPSIS 🌸

#include <libkyfilewatcher.hpp>

Classes

  • class KYSDK_FILEWATCHER::FileWatcher — the class bestie lives in 🫶

Functions

QStringList removeWatchTargetRecursive(QString url, int maxdepth = 5,
    int recurType = ALLFILE);

Link with -lkyfilewatcher.

Yes queen, you gotta link it. No link, no function, that's the vibe check.


🦋 DETAILED DESCRIPTION 🦋

The main function of the interface is to remove the specified file from the listening list. Periodt. 💅

The argument url is the file path. Like, the path. The one. Give her the path.

The argument maxdepth is the maximum depth specified for traversal search. How deep do we go? That deep. Default 5, so if you say nothing she goes five levels and stops, respectfully.

The argument recurType is the recursive type,which is an enumeration type. The content is as follows:

enum RecursiveType{
    DIR = 1 << 0,
    REGULAR = 1 << 1,
    HIDDEN = 1 << 2,
    TMPFILE = 1 << 3,    //认为那些以~开头的是临时文件
    ALLFILE = HIDDEN | TMPFILE | DIR | REGULAR
};

Quick translation moment for the comment: //认为那些以~开头的是临时文件 = "things starting with ~ are considered temporary files". So TMPFILE is the backstage-pass for the ~-prefixed girlies ✨. And ALLFILE is literally everyone invited — HIDDEN | TMPFILE | DIR | REGULAR, all four flags OR'd together because she does not do exclusion, she does everybody 🎉.


💖 RETURN VALUE 💖

Bestie. This section is literally empty in the original. Nothing. Void. Crickets. 🦗

Not me leaving it blank too — because I'm not about to make up a return type claim that isn't there. The signature says QStringList in the SYNOPSIS, and that's genuinely all we're given. Don't @ me, I only report what the page says 🙈.


🔥 EXAMPLES 🔥

Okay here's the whole demo, copy-paste ready, character for character:

#include <QCoreApplication>
#include <QDebug>
#include "libkyfilewatcher.hpp"

using namespace KYSDK_FILEWATCHER;

int main(int argc, char *argv[])
{
    KYSDK_FILEWATCHER::FileWatcher watcher;
    watcher.addWatchTargetRecursive("/home/kylin/", PERIODIC, ALL, 3, REGULAR);

    getchar();

//    qDebug() << "update attr test";
//    watcher.updateWatchTargetAttribute("/data/testcode/test.c", DELETE);

//    getchar();

//    qDebug() << "re-add test";
//    watcher.addWatchTarget("/data/testcode/test.c", PERIODIC, ALL);

//    getchar();

//    qDebug() << "update oneshot test";
//    watcher.updateWatchTargetType("/data/testcode/test.c", ONESHOT);

//    getchar();

//    qDebug() << "remove target test";
//    watcher.removeWatchTarget("/data/testcode/test.c");

//    getchar();

    watcher.clearWatchList();
    return 0;
}

Notice how the whole middle chunk is commented out? That's the original's energy — she's showing you the other tests but leaving them commented so the live path stays clean. The getchar() calls are just "pause here so I can look at it" moments, and the final watcher.clearWatchList(); wipes the whole list. Slay. 👑


👑 CONFORMING TO 👑

These functions are as per the withdrawn POSIX.1e draft specification.

Withdrawn. As in, gone, archived, no longer a thing, resting in peace. She's still conforming to it though, because loyalty 🫡. Do not come at me about POSIX.1e being deprecated — I'm just the messenger, the page said it first.

The following functions are Linux extensions:

  • addWatchTargetRecursive()
  • addWatchTargetListRecursive()
  • clearWatchList()
  • pauseWatcher()
  • restartWatcher()

🌈 SEE ALSO 🌈

Go read her friends, they're all icons fr fr:


And that's the page, bestie. This whole thing is removeWatc...tRecursive(3) — yeah the header really does truncate like that, she's mysterious like that 💀 — from My Project, dated Wed Sep 20 2023. Manual page done, brain full, going to go hydrate. Bye babes 🦋💜

📦 where this page comes from