gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7078e22)
raw | patch | inline | side by side (parent: 7078e22)
author | Doni Pracner <quinnuendo@gmail.com> | |
Mon, 17 Feb 2014 18:37:49 +0000 (19:37 +0100) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Mon, 17 Feb 2014 18:37:49 +0000 (19:37 +0100) |
skripta-os2.tex | patch | blob | history |
diff --git a/skripta-os2.tex b/skripta-os2.tex
index 1a6ae56e1412e80b2e4e4401bf71a618e3ac1b39..d1e683706b40fe22f629734e3b3282f31dcff8a9 100644 (file)
--- a/skripta-os2.tex
+++ b/skripta-os2.tex
\end{codeblock}
\begin{codeblock}
-MODULE Zad5;
+MODULE Zad3;
-FROM SYSTEM IMPORT
- ADR;
FROM StrIO IMPORT
WriteString, WriteLn;
FROM NumberIO IMPORT
WriteInt;
-FROM StrLib IMPORT
- StrLen, StrConCat;
FROM Args IMPORT
Narg, GetArg;
-FROM Lib32 IMPORT
- opendir, readdir, closedir, stat, PDir, PDirEnt, Stat;
+ FROM Lib32 IMPORT
+ opendir, readdir, closedir, PDir, PDirEnt;
FROM errno IMPORT
geterrno;
VAR
dir: PDir;
entry: PDirEnt;
- info: Stat;
c: INTEGER;
- Len: CARDINAL;
- Putanja: String;
BEGIN
+ WriteString("Folder "); WriteString(Ime); WriteLn;
dir:= opendir(Ime);
IF dir = NIL THEN
- WriteString("Folder "); WriteString(Ime); WriteLn;
WriteString(" Greska broj "); WriteInt(geterrno(), 0); WriteString("."); WriteLn();
WriteString(" Ne mogu da otvorim direktorijum."); WriteLn();
ELSE
- Len:= StrLen(Ime);
- IF Ime[Len - 1] # "/" THEN
- StrConCat(Ime, "/", Ime);
- END;
- WriteString("Folder "); WriteString(Ime); WriteLn;
entry:= readdir(dir);
WHILE entry # NIL DO
IF entry^.name[0] # "." THEN
- StrConCat(Ime, entry^.name, Putanja);
- c:= stat(Putanja, ADR(info));
- WriteString(" ");
- IF c = -1 THEN
- WriteString("? ? KB");
- ELSE
- WriteInt(info.nlink, 3);
- WriteInt((info.size + 512) DIV 1024, 5); WriteString(" KB ");
- END;
- WriteString(" "); WriteString(entry^.name); WriteLn;
+ WriteString(" "); WriteString(entry^.name); WriteLn;
END;
entry:= readdir(dir);
END;
Listaj(Putanja);
END;
WriteLn;
-END Zad5.
+END Zad3.
\end{codeblock}
\subsection{Stvaranje novih procesa}