Richard Stallman dnes v Liberci přednáší o svobodném softwaru a svobodě v digitální společnosti. Od 16:30 v aule budovy G na Technické univerzitě v Liberci. V anglickém jazyce s automaticky generovanými českými titulky. Vstup je zdarma i pro širokou veřejnost.
sudo-rs, tj. sudo a su přepsáné do programovacího jazyka Rust, nahradí v Ubuntu 25.10 klasické sudo. V plánu je také přechod od klasických coreutils k uutils coreutils napsaných v Rustu.
Fedora se stala oficiální distribucí WSL (Windows Subsystem for Linux).
Společnost IBM představila server IBM LinuxONE Emperor 5 poháněný procesorem IBM Telum II.
Byla vydána verze 4.0 multiplatformního integrovaného vývojového prostředí (IDE) pro rychlý vývoj aplikaci (RAD) ve Free Pascalu Lazarus (Wikipedie). Přehled novinek v poznámkách k vydání. Využíván je Free Pascal Compiler (FPC) 3.2.2.
Podpora Windows 10 končí 14. října 2025. Připravovaná kampaň Konec desítek (End of 10) může uživatelům pomoci s přechodem na Linux.
Již tuto středu proběhne 50. Virtuální Bastlírna, tedy dle římského číslování L. Bude L značit velikost, tedy více diskutujících než obvykle, či délku, neboť díky svátku lze diskutovat dlouho do noci? Bude i příští Virtuální Bastlírna virtuální nebo reálná? Nejen to se dozvíte, když dorazíte na diskuzní večer o elektronice, softwaru, ale technice obecně, který si můžete představit jako virtuální posezení u piva spojené s učenou
… více »Český statistický úřad rozšiřuje Statistický geoportál o Datový portál GIS s otevřenými geografickými daty. Ten umožňuje stahování datových sad podle potřeb uživatelů i jejich prohlížení v mapě a přináší nové možnosti v oblasti analýzy a využití statistických dat.
Kevin Lin zkouší využívat chytré brýle Mentra při hraní na piano. Vytváří aplikaci AugmentedChords, pomocí které si do brýlí posílá notový zápis (YouTube). Uvnitř brýlí běží AugmentOS (GitHub), tj. open source operační systém pro chytré brýle.
#define EVENT_SIZE ( sizeof (struct inotify_event) ) #define BUF_LEN ( 1024 * ( EVENT_SIZE + 16 ) ) int main(int argc, char **argv) { int length, i = 0; int fd; int wd; char buffer[BUF_LEN]; fd = inotify_init(); if (fd < 0) { perror("inotify_init"); } wd = inotify_add_watch(fd, "/home/tomesh/Dropbox/C/sync", IN_ALL_EVENTS); if (length < 0) { perror("read"); } while (1) { length = read(fd, buffer, BUF_LEN); struct inotify_event *event = (struct inotify_event *) &buffer[ i ]; if (event->len) { if (event->mask & IN_CREATE) { if (event->mask & IN_ISDIR) { printf("The directory %s was created.\n", event->name); } else { printf("The file %s was created.\n", event->name); } } if (event->mask & IN_DELETE) { if (event->mask & IN_ISDIR) { printf("The directory %s was deleted.\n", event->name); } else { printf("The file %s was deleted.\n", event->name); } } if (event->mask & IN_MODIFY) { if (event->mask & IN_ISDIR) { printf("The directory %s was modified.\n", event->name); } else { printf("The file %s was modified.\n", event->name); } } if (event->mask & IN_MOVED_FROM) { if (event->mask & IN_ISDIR) { printf("The directory %s with cookie %d was moved from.\n", event->name, event->cookie); } else { printf("The file %s with cookie %d was moved from.\n", event->name, event->cookie); } } if (event->mask & IN_MOVED_TO) { if (event->mask & IN_ISDIR) { printf("The directory %s with cookie %d was moved to.\n", event->name, event->cookie); } else { printf("The file %s with cookie %d was moved to.\n", event->name, event->cookie); } } if (event->mask & IN_MOVE_SELF) { if (event->mask & IN_ISDIR) { printf("The directory %s with cookie %ds was itself moved.\n", event->name, event->cookie); } else { printf("The file %s with cookie %d was itself moved.\n", event->name, event->cookie); } } if (event->mask & IN_DELETE_SELF) { if (event->mask & IN_ISDIR) { printf("The directory %s with cookie %d was itself deleted.\n", event->name, event->cookie); } else { printf("The file %s with cookie %d was itself deleted.\n", event->name, event->cookie); } } if (event->mask & IN_OPEN) { if (event->mask & IN_ISDIR) { printf("The directory %s with cookie %d was opened.\n", event->name, event->cookie); } else { printf("The file %s with cookie %d was opened.\n", event->name, event->cookie); } } if (event->mask & IN_ATTRIB) { if (event->mask & IN_ISDIR) { printf("The directory %s with cookie %d attr was changed.\n", event->name, event->cookie); } else { printf("The file %s with cookie %d attr was changed.\n", event->name, event->cookie); } } if (event->mask & IN_ACCESS) { if (event->mask & IN_ISDIR) { printf("The directory %s with cookie %d was accessed.\n", event->name, event->cookie); } else { printf("The file %s with cookie %d was accessed.\n", event->name, event->cookie); } } } } (void) inotify_rm_watch(fd, wd[0]); (void) close(fd); exit(0); }
Řešení dotazu:
i += EVENT_SIZE + event->len;
#define EVENT_SIZE ( sizeof (struct inotify_event) ) #define BUF_LEN ( 1024 * ( EVENT_SIZE + 16 ) ) int main(int argc, char **argv) { int length, i; int fd; int wd; char buffer[BUF_LEN]; struct inotify_event *event; fd = inotify_init(); if (fd < 0) perror("inotify_init"); wd = inotify_add_watch(fd, "/home/tomesh/Dropbox/C/sync", IN_ALL_EVENTS); while (1) { i = 0; length = read(fd, buffer, BUF_LEN); if (length < 0) perror("read"); if (length == 0) sleep(1); while (i < length) { event = (struct inotify_event *) &buffer[i]; if (event->mask & IN_CREATE) { if (event->mask & IN_ISDIR) { printf("The directory %s was created.\n", event->name); } else { printf("The file %s was created.\n", event->name); } } if (event->mask & IN_DELETE) { if (event->mask & IN_ISDIR) { printf("The directory %s was deleted.\n", event->name); } else { printf("The file %s was deleted.\n", event->name); } } if (event->mask & IN_MODIFY) { if (event->mask & IN_ISDIR) { printf("The directory %s was modified.\n", event->name); } else { printf("The file %s was modified.\n", event->name); } } if (event->mask & IN_MOVED_FROM) { if (event->mask & IN_ISDIR) { printf("The directory %s with cookie %d was moved from.\n", event->name, event->cookie); } else { printf("The file %s with cookie %d was moved from.\n", event->name, event->cookie); } } if (event->mask & IN_MOVED_TO) { if (event->mask & IN_ISDIR) { printf("The directory %s with cookie %d was moved to.\n", event->name, event->cookie); } else { printf("The file %s with cookie %d was moved to.\n", event->name, event->cookie); } } if (event->mask & IN_MOVE_SELF) { if (event->mask & IN_ISDIR) { printf("The directory %s with cookie %ds was itself moved.\n", event->name, event->cookie); } else { printf("The file %s with cookie %d was itself moved.\n", event->name, event->cookie); } } if (event->mask & IN_DELETE_SELF) { if (event->mask & IN_ISDIR) { printf("The directory %s with cookie %d was itself deleted.\n", event->name, event->cookie); } else { printf("The file %s with cookie %d was itself deleted.\n", event->name, event->cookie); } } if (event->mask & IN_ATTRIB) { if (event->mask & IN_ISDIR) { printf("The directory %s with cookie %d attr was changed.\n", event->name, event->cookie); } else { printf("The file %s with cookie %d attr was changed.\n", event->name, event->cookie); } } if (event->mask & IN_ACCESS) { if (event->mask & IN_ISDIR) { printf("The directory %s with cookie %d was accessed.\n", event->name, event->cookie); } else { printf("The file %s with cookie %d was accessed.\n", event->name, event->cookie); } } i += sizeof(struct inotify_event) +event->len; } } (void) inotify_rm_watch(fd, wd); (void) close(fd); exit(0); }
Tiskni
Sdílej: