Spec-Zone.ru › Nim

std/private/oscommon

Source Edit

Импорты

oserrors, winlean, times

Типы

PathComponent = enum
  pcFile,                   ## path refers to a file
  pcLinkToFile,             ## path refers to a symbolic link to a file
  pcDir,                    ## path refers to a directory
  pcLinkToDir                ## path refers to a symbolic link to a directory

Перечисление, определяющее компонент пути.

См. также:

  • osdirs: итератор walkDirRec
  • os: объект FileInfo
Source Edit
ReadDirEffect = object of ReadIOEffect
Эффект, обозначающий операцию чтения из структуры каталога. Source Edit
WriteDirEffect = object of WriteIOEffect
Эффект, обозначающий операцию записи в структуру каталога. Source Edit

Константы

weirdTarget = false
Source Edit

Процедуры

proc dirExists(dir: string): bool {....gcsafe, extern: "nos$1",
                                    tags: [ReadDirEffect], sideEffect,
                                    ...raises: [], forbids: [].}

Возвращает true, если каталог dir существует. Если dir является файлом, возвращается false. Следит за символическими ссылками.

См. также:

  • процедура fileExists
  • процедура symlinkExists
Source Edit
proc fileExists(filename: string): bool {....gcsafe, extern: "nos$1",
    tags: [ReadDirEffect], sideEffect, ...raises: [], forbids: [].}

Возвращает true, если filename существует и является обычным файлом или символической ссылкой.

Каталоги, файлы устройств, именованные каналы и сокеты возвращают false.

См. также:

  • процедура dirExists
  • процедура symlinkExists
Source Edit
proc findFirstFile(a: string; b: var WIN32_FIND_DATA): Handle {....raises: [],
    tags: [], forbids: [].}
Source Edit
proc openHandle(path: string; followSymlink = true; writeAccess = false): Handle {.
    ...raises: [], tags: [], forbids: [].}
Source Edit
proc skipFindData(f: WIN32_FIND_DATA): bool {.inline, ...raises: [], tags: [],
    forbids: [].}
Source Edit
proc symlinkExists(link: string): bool {....gcsafe, extern: "nos$1",
    tags: [ReadDirEffect], sideEffect, ...raises: [], forbids: [].}

Возвращает true, если символическая ссылка link существует. Возвратит true независимо от того, указывает ли ссылка на каталог или файл.

См. также:

  • процедура fileExists
  • процедура dirExists
Source Edit
proc tryMoveFSObject(source, dest: string; isDir: bool): bool {.
    ...raises: [OSError], tags: [], forbids: [].}

Перемещает файл (или каталог, если isDir равно true) из source в dest.

Возвращает false в случае ошибки EXDEV или AccessDeniedError в Windows (если isDir равно true). В случае других ошибок возбуждается OSError. Возвращает true в случае успеха.

Source Edit

Шаблоны

template findNextFile(a, b: untyped): untyped
Source Edit
template getFilename(f: untyped): untyped
Source Edit
template wrapBinary(varname, winApiProc, arg, arg2: untyped)
Source Edit
template wrapUnary(varname, winApiProc, arg: untyped)
Source Edit

© 2006–2024 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/oscommon.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API