@wywm@z[y[W
ŏIXVF2025N12
@C̓o͊ȉɌf܂Bt@CE|C^ʂēo͂sƁAt@CEfBXNv^ēo͂sᐅ2ʂ肠܂B
@t@C(t@CE|C^ő삷)openƂmodeɂ́A"r"(ǂݍ݃[h)C"w"(݃[h)C"a"(lj݃[h)C"r+"(ǂݏ[h)C"w+"(ǂݏ[h)C"a+"(ǂݍݒlj݃[h)wł܂Bmode="r"Cmode="a"open悤Ƃ̂Ƀt@C݂ȂƁAG[ɂȂ܂Bmode="w"Cmode="w+"openƁAɂ̃t@C݂ĂꍇA̓e͔j܂Bmode="a"Cmode="a+"openƁA̓ěɏ݂s܂B
@fprintf()Cprintf()Csprintf()Cvfprintf()Cvprintf()Cvsprintf()format̏ɂẮAC̎vprintf()̐QƂĂB @fscanf()Cscanf()Csscanf()Cvfscanf()Cvscanf()Cvsscanf()convŎw肷ϊẃA
%c ƂđΉ|C^wchar^ϐɓǂݍ݂܂B
%s ƂđΉ|C^ȍ~̕ɓǂݍ݂܂B
%d 10iƂđΉ|C^wint^A܂short^ϐɓǂݍ݂܂B
%f _ƂđΉ|C^wfloat^ϐɓǂݍ݂܂B
%lf {x_ƂđΉ|C^wϐɓǂݍ݂܂B
t@CŃG[ꍇAerrnoɃG[ԍZbg(<errono.h>includeĂ)ꍇ́Aprintf("%s\n", strerror(errno));Ƃ邱ƂɂAG[bZ[W\邱Ƃł܂B
int chdir(char *pathname)
@JgEfBNgpathnamefBNgɕύX܂B0CsƁ|1Ԃ܂B<unistd.h>includeĂB
int chmod(char *pathname, mode_t permission)
@pathnameŎw肵t@Cpermission2̎wɕύX܂B0CsƁ|1Ԃ܂B<sys/stat.h>includeĂBWindows̏ꍇAł̐ݒʂɂȂƂ܂B
@modéAȉ̊etO̘_aƂ܂B
S_IRUSR (0400)@owner̓ǂݏo
S_IWUSR (0200)@owneȑ
S_IXUSR (0100)@owner̎s
S_IRGRP (0040)@group̓ǂݏo
S_IWGRP (0020)@group̏
S_IXGRP (0010)@group̎s
S_IROTH (0004)@other̓ǂݏo
S_IWOTH (0002)@otheȑ
S_IXOTH (0001)@other̎s
Ԋɂݒmode = 0x777ŁAt@C͒NɂĂ܂Bmode = 0ɂĂ܂ƃt@C݂̑̈Ӗ܂BЂƂ肪łΗǂƂ̂łAmode = 0x700Ƃ܂B
int close(int fd)
@ᐅt@CclosełBt@CEfBXNv^fdŎw肳t@Cclose܂B0CsƁ|1Ԃ܂B<unistd.h>includeĂB
int closedir(DIR *pd1)
@fBNgE|C^pd1Ŏw肳fBNgclose܂BcloseƁA0Ԃ܂B<dirent.h>includeĂB
int creat(char *pathname, mode_t permission)
@ᐅt@CłBopen(pathname, O_CREAT | O_WRONLY | O_TRUNC, permission)Ɠ܂B2permissionɂẮAchmod()QƂĂB
int fclose(FILE *pf1)
@t@CE|C^pf1Ŏw肳t@Cclose܂BcloseƁA0Ԃ܂B<stdio.h>includeĂB
FILE *fdopen(int fd, char *mode)
@ᐅopenĂꍇɁAt@CEfBXNv^fdɑΉt@CE|C^Ԃ܂Bmode͏LQƂĂB<stdio.h>includeĂB
int feof(FILE *pf1)
@t@CE|C^pf1Ŏw肳t@CEOF(End of File)ɓBĂꍇ0ȊO̒lAEOFɓBĂȂꍇ0Ԃ܂Bǂݍ݂Ă邩ǂ̊mF邱Ƃł܂B<stdio.h>includeĂB
int ferror(FILE * pf1)
@t@CE|C^pf1Ŏw肳t@CɃG[Ăꍇ0ȊO̒lԂ܂BG[ĂȂ0Ԃ܂B<stdio.h>includeĂB
int fflush(FIILE *pf1)
@t@CE|C^pf1Ŏw肳t@C̃obt@ɗ܂Ăeo͂Aobt@NA܂BI0Ԃ܂BG[ƁAEOF(|1)Ԃ܂B<stdio.h>includeĂB
int fgetc(FILE *pf1)
@t@CE|C^pf1Ŏw肷t@C1ǂݍŕԂ܂Bt@CɓBĂ邩G[EOFԂ܂B<stdio.h>includeĂB
int fgetpos(FILE *pf1, fpos_t *pos)
@t@CE|C^pf1Ŏw肷t@C̈ʒupos̎wϐɕԂ܂BI0Ԃ܂BُI0ȊO̒lԂ܂B<stdio.h>includeĂB
char *fgtes(char *buffer, int n, FILE *pf1)
@t@CE|C^pf1Ŏw肷t@C當0܂߂nbufferɓǂݍ݂܂Bbuffer̃TCYnoCgȏKvłBIƁAbuffer̒lԂ܂BG[NULLԂ܂B<stdio.h>includeĂBȂAC̎vfgets()̉QƂĂB
int fileno(FILE *pf1)
@t@CE|C^pf1Ŏw肷t@C̃t@CEfBXNv^Ԃ}NłBُIƁ|1Ԃ܂B<stdio.h>includeĂB
FILE *fopen(char *filename, char *mode)
@filenameɎw肷t@C̃t@CopenAt@CE|C^Ԃ܂Bmode͏LQƂĂB<stdio.h>includeĂB
int fprintf(FILE *pf1, char *format, ...)
@t@CE|C^pf1Ŏw肷t@CɁAprintf()̑1Ɠl̏w蕶formatɏ]āA3ȍ~̃f[^o͂܂B<stdio.h>includeĂB
int fputc(int c, FILE *pf1)
@ct@CE|C^pf1Ŏw肷t@Cɏ݂܂BIꍇ́AcԂ܂BG[EOFԂ܂B<stdio.h>includeĂB
int fputs(char *string, FILE *pf1)
@t@CE|C^pf1Ŏw肷t@CɁAstring݂܂B0͏݂܂BI0ȏ̒lԂ܂BG[EOFԂ܂B<stdio.h>includeĂBȂAC̎vfputs()̉QƂĂB
size_t fread(void *buffer, size_t size, size_t count, FILE *pf1)
@t@CE|C^pf1Ŏw肷t@CAbufferɁAsize~countoCgǂݍ݂܂Bǂݍ݂łcountԂ܂B<stdio.h>includeĂB
FILE *freopen(char *filename, char *mode, FILE *pf1)
@t@CE|C^pf1Ŏw肷t@CāAfilenameŎw肷t@CopenAt@CE|C^Ԃ܂BmodeɂĂ͏LQƂĂB<stdio.h>includeĂB
int fscanf(FILE *pf1, char *conv, ...)
@t@CE|C^pf1Ŏw肷t@Cϊw蕶convɏ]āA3Ԗڈȍ~̈̃|C^w̕ϐɃf[^ǂݍ݁AǂݍtB[hԂ܂BG[́AEOFԂ܂BconvɂẮALQƂĂB<stdio.h>includeĂB
int fseek(FILE *pf1, long offset, int origin)
@t@CE|C^pf1Ŏw肷t@C̈ʒuoriginŎw肷ʒuoffsetoCgʒuɈړ܂BorigińASEEK_SET(t@C̐擪)CSEEK_CUR(t@Č݈ʒu)CSEEK_END(t@C̖)̂ꂩw肵܂BȈꍇ0Ԃ܂B<stdio.h>includeĂB
int fsetpos(FILE *pf1, fpos_t *pos)
@t@CE|C^pf1Ŏw肷t@C̈ʒupos̒lɐݒ肵܂Bʏ́Afgetpos()Ŏ擾lłBȈꍇ0Ԃ܂B<stdio.h>includeĂB
long ftell(FILE *pf1)
@t@CE|C^pf1Ŏw肷t@C̈ʒuԂ܂BG[́|1Ԃ܂B<stdio.h>includeĂB
size_t fwrite(void *buffer, size_t size, size_t count, FILE *pf1)
@t@CE|C^pf1Ŏw肷t@CɁAbufferȍ~size~countoCg̃f[^oAcountԂ܂B<stdio.h>includeĂB
int getc(FILE *pf1)
@t@CE|C^pf1Ŏw肷t@C1ǂݍŕԂ}NBAZLeBォ͓l@\̊fgetc()̎gp]܂B<stdio.h>includeĂB
int getchar()
@W͂1ǂݍŕԂ܂B<stdio.h>includeĂB
char *getcwd(char *buffer, size_t size)
@JgEfBNg̖ObufferɊi[܂Bsizebuffer̃TCYw肵܂Abuffer͏[ȑ傫łȂȂ܂BƐpXւ̃|C^ԂAsNULLԂ܂B<unistd.h>includeĂB
char *gets(char *buffer)
@W͂1sǂݍbufferɊi[܂BZLeB[̖肪gȂƁBɁAfgets()gƁB
int mkdir(char *pathname, mode_t permission)
@pathnameŎw肳閼ÕfBNg쐬܂B2permissionݒ肵܂B0Cs0ȊOԂ܂B<unistd.h>includeĂB
int open(char *pathname, int option, mode_t permission)
@ᐅt@CopenłBpathnamew肵ăt@CopenAt@CEfBXNv^Ԃ܂BoptiońAO_RDONLYCO_WRONLYCO_RDWR̂ꂩƁAO_APPEND(NjLopen)CO_CREAT(t@Copen)CO_TRUNC(̃t@CȂTCY0ɂopen)CO_TEXTCO_BINARŶ̔Cӂ̂̂Ƃ̘_aw肵܂BoptionO_CREATw肵ꍇ̂݁A3permission(chmod()Q)w肵܂BopenɎsꍇA|1Ԃ܂B<fcntl.h>includeĂB
DIR *opendir(char *dirname)
@fBNgdirnamew肵āAfBNgopenAfBNgE|C^Ԃ܂BIłȂꍇANULLԂ܂B<dirent.h>includeĂB
int printf(char *format, ...)
@format̎wɏ]āAWo͂ɕo͂܂Bo͂镶Ԃ܂B<stdio.h>includeĂBȂAC̎vprintf()̉QƂĂB
int putc(int c, FILE *pf1)
@t@CE|C^pf1Ŏw肳t@C1cރ}NBԂ܂BG[́AEOFԂ܂B<stdio.h>includeĂB
putchar()
@Wo͂1c݂܂BԂ܂BG[EOFԂ܂B<stdio.h>includeĂB
int puts(char *string)
@Wo͂ɕstringA'\n'tďo͂܂BȈꍇ͕łȂԂ܂BG[EOFԂ܂B<stdio.h>includeĂB
ssize_t read(int fd, void *buffer, size_t size)
@ᐅt@Cǂݍ݊łBt@CEfBXNv^fdŎw肳t@CAobt@bufferɁAsizeoCgǂݍ݂܂Bbuffer͏[ȃTCYĂKv܂Bɓǂݍ߂ꍇɂ͓ǂݍoCgԂ܂BsƂɂ́|1Ԃ܂B<unistd.h>includeĂB
struct dirent *readdir(DIR *pdir1)
@fBNgE|C^pdir1Ŏw肷fBNg1GgoAGg̏Ldirent\̂ւ̃|C^Ԃ܂B1GgoƁÃGgɈڂAŌ̃GgoĂ܂NULLԂ܂BNULLԂ܂while[vŌJԂreaddir(pdir1)ĂяoƂɂAfBNg̑St@C𑖍ł܂Breaddir(pdir1)̖߂lpdirɓƁApdir->d_typeŃGgfBNg(DTQDIR)Ȃ̂At@C(DT_REG)Ȃ̂A܂Apdir->d_nameŃGg(t@C܂̓fBNg)擾ł܂B<dirent.h>includeĂB
int remove(char *filename)
@filenameƂÕt@C폜܂BȈꍇ0Ԃ܂BG[0ȊO̒lԂ܂B<stdio.h>includeĂB
int rename(char *oldname, *newname)
@oldnameƂÕt@C̃t@CnewnameɕύX܂BȈꍇ0Ԃ܂BG[0ȊO̒lԂ܂B<stdio.h>includeĂB
void rewind(FILE *pf1)
@t@CE|C^pf1Ŏw肷t@C̈ʒut@C擪ɖ߂܂B<stdio.h>includeĂB
void rewinddir(DIR *pdir1)
@fBNgE|C^pdir1Ŏw肷fBNgŁAŏ̃Ggɖ߂܂B<dirent.h>includeĂB
int rmdir(char *pathname)
@pathnameŎw肷pX̃fBNg폜܂BOɃfBNg̃t@CATufBNg폜ĂKv܂B0ԂAfBNgłȂƎs0ȊOԂ܂B<unistd.h>includeĂB
int scanf(char *conv, ...)
@W͂ϊw蕶convɏ]āA2Ԗڈȍ~̈̃|C^w̕ϐɃf[^ǂݍ݁AǂݍtB[hԂ܂BG[́AEOFԂ܂BconvɂẮALQƂĂB<stdio.h>includeĂB
void setbuf(FILE *pf1, char *buffer)
@Cł́At@C̓o͂̂߂ɓIɃobt@mۂ܂Åpĕʂ̃obt@w肷邱Ƃł܂Bsetbuf()̓t@CE|C^pf1̎w肷t@C̃obt@Ƃbufferg悤Ɏw肵܂BAAbuffeȓ傫́A}N`ĂBUFSIZƂ܂B<stdio.h>includeĂB
int setvbuf(FILE *pf1, char *buffer, int type, size_t size)
@t@CE|C^pf1̎w肷t@C̃obt@Ƃbufferg悤Ɏw肵܂Btypeɂ́A_IOBUF(obt@tɂȂ܂Ńobt@)C_IOLBUF(s邩obt@tɂȂ܂Ńobt@)C_IONBUF(obt@gȂ)̂ꂩw肵܂Bsize̓obt@̃TCYłBIɂ0Ԃ܂B<stdio.h>includeĂB
int sprintf(char *buffer, char *format, ...)
@bufferȍ~ɁAprintf()̑1Ɠl̏w蕶formatɏ]āA3ȍ~̃f[^o͂܂BԂ܂B<stdio.h>includeĂBȂAformatɂẮAC̎vprintf()̉QƂĂB
int sscanf(char *buffer, char *conv, ...)
@bufferȍ~Aϊw蕶convɏ]āA3Ԗڈȍ~̈̃|C^w̕ϐɃf[^ǂݍ݁AǂݍtB[hԂ܂BG[́AEOFԂ܂BconvɂẮALQƂĂB<stdio.h>includeĂB
int stat(char *pathname, struct stat *ps1)
@pathnameŎw肳pX(t@C܂̓fBNg)̏擾ApsɊi[܂B0CsƁ|1Ԃ܂B<sys/stat.h>includeĂBȉ̂悤ȂƂׂ邱Ƃł܂B
ps1->st_sizeɃt@C̃TCY(oCg)Ă܂B
ps1->st_modeɃt@C̎ނpermissionĂ܂(ps1->st_mode & 0x777ƂƁAchmod()̂Ƃɏpermissiono܂Bps1->st_mode & _S_IFDIRƂ0łȂfBNgłBps1->st_mode & _S_IFREGƂ0łȂt@Cł)B
ps1->st_atimeɃt@C̍ŏIANZXĂ܂B
ps1->st_mtimeɃt@C̍ŏIύXĂ܂B
ps1->st_ctimeɃt@C̍쐬Ă܂B
S_ISREG(ps1->st_mode)@ʏt@Cǂׂ}NłB0ȊÔƂʏt@C
S_ISDIR(ps1->st_mode)@fBNgǂׂ}NłB0ȊÔƂfBNg
FILE *tmpfile()
@ꎞt@CopenAt@CE|C^Ԃ܂BNULLԂꍇ͎sĂ܂B<stdio.h>includeĂB
char *tmpnam(char *filename)
@̃t@CƏdȂ悤ȃt@CAfilenameȍ~Ɋi[܂BfilenameƂNULLw肵ꍇɂ́AIɕێ܂(őTMP_MAX)BAAt@Cw|C^ԂAsNULLԂ܂B<stdio.h>includeĂB
mode_t umask(mode_t mask)
@t@CfBNg쐬̃}XNw肵܂B1Ɏw肵rbǵAopen()Cmkdir()Ccreat()ł́Apermisioñrbg0ɂȂ܂B<sys/stat.h>includeĂBWindows̏ꍇA̐ݒʂɂȂƂ܂B
int ungetc(int c, FILE *pf1)
@t@CE|C^pf1Ŏw肳t@CǂݍcAt@C̈ʒuɖ߂܂Bt@C玟ɓǂݏocłB<stdio.h>includeĂB
int vfprintf(FILE *pf1, char *format, va_list ap)
@ό}N𗘗p鏑to͊łBt@CE|C^pf1Ŏw肳t@CɁAprintf()̑1Ɠl̏w蕶formatɏ]āAva_list^apɕłϐ̃f[^o͂܂BIƁAoCgԂ܂BformatɂĂ͏LQƂĂBG[ƕlԂ܂B<stdio.h><stdarg.h>includeĂBȉAvɂȂɂẮAĈ̑̊1Ds̉ϒ}NAva_argCva_copyCva_endCva_start̐QƂĂB
int vfscanf(FILE *pf1, char *format, va_list ap)
@ό}N𗘗pAt@CE|C^pf1Ŏw肳t@CAϊw蕶convɏ]āAva_list^apɕł|C^̎wϐɃf[^ǂݍ݁AǂݍtB[hԂ܂BG[́AEOFԂ܂BconvɂẮALQƂĂB<stdio.h>includeĂB
int vprintf(char *format, va_list ap)
@ό}N𗘗pAWo͂printf()̑1Ɠl̏w蕶formatɏ]āAva_list^apɕłϐ̃f[^o͂܂BformatɂĂprintf()QƂĂBIƁAoCgԂ܂BG[ƕlԂ܂B<stdio.h>includeĂB
int vscanf(char *conv, va_list ap)
@ό}N𗘗pAW͂ϊw蕶convɏ]āAva_list^apɕł|C^̎wϐɃf[^ǂݍ݁AǂݍtB[hԂ܂BG[́AEOFԂ܂BconvɂẮALQƂĂB<stdio.h>includeĂB
int vsprintf(char *buffer, char *format, va_list ap)
@ό}N𗘗pAbufferȍ~printf()̑1Ɠl̏w蕶formatɏ]āAva_list^apɕłϐ̃f[^o͂܂BoCgԂ܂BformatɂĂprintf()QƂĂB<stdio.h>includeĂB
int vsscanf(char *buffer, char *conv, va_list ap)
@ό}N𗘗pAbufferȍ~Aϊw蕶convɏ]āAva_list^apɕł|C^̎wϐɃf[^ǂݍ݁AǂݍtB[hԂ܂BG[́AEOFԂ܂BconvɂẮALQƂĂB<stdio.h>includeĂB
ssize_t write(int fd, void *buffer, int size)
@ᐅt@C݊łBt@CEfBXNv^fdŎw肳t@CɁAbufferȍ~sizeoCg݂܂B߂ꍇɂ́AoCgԂ܂Bsꍇ́A|1Ԃ܂B<unistd.h>includeĂB
yLz@LłB̊F܂̂x肽A낵肢܂B
yLz@L͂܂łłB