summary refs log tree commit diff stats
path: root/lib/pure/os.nim
Commit message (Collapse)AuthorAgeFilesLines
* clarify the docs of existsOrCreateDir a bit (#17182)flywind2021-02-251-4/+3
| | | | | | | * remove unnecessary when statement * remove outdated codes * clarify the docs a bit
* mark inline (#17180)flywind2021-02-241-2/+2
|
* [nodejs backend] paramStr, paramCount (#17082)flywind2021-02-181-9/+33
|
* fix the unused warnings on windows (#17073)flywind2021-02-171-8/+13
|
* remove all uses of condsyms symbols defined prior to bootstrap nim 0.20.0 ↵Timothee Cour2021-02-171-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#16918) * nimNoArrayToCstringConversion deadcode * nimbabel deadcode * nimHasalignOf deadcode * nimvarargstyped deadcode * nimhygiene deadcode * nimNewTypedesc deadcode * nimlocks deadcode * nimHasCppDefine deadcode * nimHasRunnableExamples deadcode * nimHasNilChecks deadcode * nimSymKind deadcode * minor macros refactoring * nimVmEqIdent deadcode * nimNoNil deadcode * nimNoZeroTerminator deadcode * nimHasSymOwnerInMacro deadcode * nimVmExportFixed deadcode * nimNewRuntime deadcode * nimAshr deadcode * nimUncheckedArrayTyp deadcode * nimHasTypeof deadcode * nimErrorProcCanHaveBody deadcode * nimHasHotCodeReloading deadcode * nimHasSignatureHashInMacro deadcode * nimHasDefault deadcode * nimMacrosSizealignof deadcode
* [Minor] improve the docs of getTempDir (#17058)flywind2021-02-161-3/+5
| | | | | | | | | * [Minor] improve the docs of getTempDir * more clear * Update lib/pure/os.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* better getTempDir (#16914)flywind2021-02-151-14/+47
| | | | | | | | | | | * better getTempDir * fix comments * better * address comments * use uint32
* fix some warnings (#16952)flywind2021-02-081-11/+11
|
* stdlib/os: handle symlinks in copy/move functions (#16709)Roman Inflianskas2021-02-041-107/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | * stdlib/os: handle symlinks in copy/move functions - Added optional `options` argument to `copyFile`, `copyFileToDir`, and `copyFileWithPermissions`. By default, symlinks are followed (copy files symlinks point to). - `copyDir` and `copyDirWithPermissions` copy symlinks as symlinks (instead of skipping them as it was before). - `moveFile` and `moveDir` move symlinks as symlinks (instead of skipping them sometimes as it was before). - Added optional `followSymlinks` argument to `setFilePermissions`. See also: https://github.com/nim-lang/RFCs/issues/319 Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * Address comments in #16709 Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * Address comments in #16709 (second iteration) Skip symlinks on Windows. Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* 2.5x- 3x faster copyFile on osx (#16883)Timothee Cour2021-02-011-0/+31
|
* remove private checkSymlink (redundant with symlinkExists) (#16785)Timothee Cour2021-01-221-16/+12
|
* Deprecate TaintedString (#15423)Juan Carlos2021-01-151-9/+9
| | | | Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
* minor fix to Posix part of walkDir (#16234)Andrey Makarov2020-12-031-13/+19
| | | | | | | | | * change break->continue and rewrite one-yield-style * use case statement for clarity * Tiny nit Co-authored-by: Clyybber <darkmine956@gmail.com>
* fix https://github.com/nim-lang/RFCs/issues/286: add FileInfo.blockSize (#16023)Timothee Cour2020-11-181-34/+37
|
* Fix a problem for long symlinks in conda (#15908) [backport]Christopher Dunn2020-11-121-9/+10
| | | * https://github.com/conda-forge/nim-feedstock/commit/d8c80ea69dca30d99073d33845ddd79f9892755b#diff-e1d8e552330911f9f779f85b6f2c00a15e790dcc3fbb3b28f5da1d660a30c5b8
* os: add overload copyFile*(source, dest: string, isDir = false) (#15537)Timothee Cour2020-10-111-1/+7
| | | | | * os: add overload copyFile*(source, dest: string, isDir = false) * renamed to copyFileToDir
* os: make getApplFreebsd available for NetBSD (#15381)alaviss2020-09-211-1/+1
| | | | | | NetBSD was switched to getApplFreebsd() in #15359, however the proc was not made available for the said target. This commit exposes `getApplFreebsd()` to NetBSD.
* Use sysctl on NetBSD to get exe name (#15359)Euan2020-09-181-3/+10
|
* template hygiene (#15240)Andy Davidoff2020-08-291-10/+13
|
* deprecate existsDir; use dirExists instead (#14884)Timothee Cour2020-07-031-17/+11
|
* {.deprecated: [existsFile: fileExists].} (#14735)Timothee Cour2020-07-021-17/+16
| | | | | | | | | * {.deprecated: [existsFile: fileExists].} * s/existsFile/fileExists/ except under deps * workaround pending #14819 * fix test
* init checks and 'out' parameters (#14521)Andreas Rumpf2020-06-231-2/+4
| | | | | | | | | | | * I don't care about observable stores * enforce explicit initializations * cleaner code for the stdlib * stdlib: use explicit initializations * make tests green * algorithm.nim: set result explicitly * remove out parameters and bring the PR into a mergable state * updated the changelog
* fix #14179, fix #14142, make CI 1.4x faster (2x faster locally) (#14658)Timothee Cour2020-06-161-69/+62
| | | | | | | | | | | | | | | * fix #14142: no more clash with: import os + use of existsDir/dirExists/existsFile/fileExists/findExe in config.nims * remove a comment * Revert "fixes the regression #12860 caused; hotfix" This reverts commit 3d2459bdc0b6d6236a2cd9209ed81c965ee411a5. * Revert "Undefine `paramCount` & `paramStr` in nimscript.nim for *.nims (#12860)" This reverts commit d38853c504d89d6e361f064a17391afaf42d74b8. * noNimScript => noWeirdTarget + noNimJs
* normalizeExe (#14668)Timothee Cour2020-06-151-2/+14
|
* remove isMainModule from json,os,sequtils (#14572)Timothee Cour2020-06-061-63/+0
| | | | | * move json.isMainModule => tjson * move isMainModule => tos,tsequtils
* Fix #14057 - moveFile should overwrite on Windows (#14433)genotrance2020-05-231-2/+2
|
* Fix #14201 (#14202)slangmgh2020-05-031-1/+1
|
* move since from inclrtl to std/private/since (#14188)hlaaftana2020-05-021-0/+1
| | | | * move since from inclrtl to std/private/since * move since import in system below for HCR
* change 'iff' to 'if' to stop "corrections" once and for all (#14182)Miran2020-05-011-5/+5
|
* fixes the regression #12860 caused; hotfixAraq2020-04-301-1/+1
|
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-281-3/+3
| | | | | | | | | | | | | | * Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
* Undefine `paramCount` & `paramStr` in nimscript.nim for *.nims (#12860)Neelesh Chandola2020-04-271-1/+17
| | | | | | | * Remove `paramStr` and `paramCount` from implicitly imported nimscript.nim * Update changelog.md * Update stable nimble commit hash Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fix #13222: make relativePath more robust and flexible (#13451)Timothee Cour2020-04-211-68/+90
| | | | | | | | | * * relativePath(foo) now works * relativePath(rel, abs) and relativePath(abs, rel) now work (fixes #13222) * relativePath, absolutePath, getCurrentDir now available in more targets (eg: vm, nodejs etc) * fix bug: isAbsolutePath now works with -d:js; add tests * workaround https://github.com/nim-lang/Nim/issues/13469 * remove `relativePath(path)` overload for now * add back changelog after rebase
* #12103 - CI for OpenBSD (#12105)Euan2020-04-211-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Working on OpenBSD CI * Condense steps into 2 steps to make output easier to follow. * Move up one directory after csources build. * Remove FreeBSD build manifest and add OpenBSD test ignores for coroutines and hot code reloading. * If runCI fails, run the test results script. * Add email trigger for build failure * Remove .git from repository URL * Disable SFML test on OpenBSD * Disable tgetaddrinfo on OpenBSD as only UDP and TCP protocols are supported. * Remove getFilePermissions as it causes CI test failures with NimScript. * Set clang as cc in nim.cfg and use gmake to build csources. * Add getCurrentDir to nimscript. * Remove duplicate getCurrentDir and check for not weirdTarget. * Add CI badge for OpenBSD. * Disable tests which allocate lots of memory for OpenBSD. * Use `CORO_BACKEND_SETJMP` on OpenBSD rather than ucontext. * Simplify building of koch * Disable t8657 on OpenBSD. See issue #13760. * Fix #12142 - tarray_of_channels fails on OpenBSD * Disable thhtpclient_ssl and tosprocterminate on OpenBSD. These tests can be enabled at a later date after fixing them. * Install libffi. * Set path to libc for openbsd. * Disable tevalffi for now. * Remove tevalffi.nim. * Use ncpuonline sysctl rather than ncpu. * Disable tacceptcloserace and tasynchttpserver on OpenBSD. * Enable tacceptcloserace and tasynchttpserver. * Fix #13775 as suggested by @alaviss - use /bin/cat on OpenBSD rather than /bin/sh. * Enable test on OpenBSD. * Disable tflowvar on OpenBSD.
* #13806 - getApplFreebsd might lose data (#13807)Euan2020-03-311-16/+16
| | | | | | | | | * #13806 - first call sysctl with a null buffer to get the length, then alloc buffer and call again * Use csize_t rather than csize * Suggestions from @Clyybber Co-authored-by: Euan Torano <euan.torano@bluesky-wireless.co.uk>
* add error for missing commandLineParams (#13719)Andy Davidoff2020-03-231-0/+4
| | | | | | | * add error for missing commandLineParams * fixup * rewrite
* [ci skip] add back unintentionally removed linenarimiran2020-03-201-0/+1
|
* [RFC] 'walkDir' now has a new 'checkDir' flag, to mimic behaviour of other ↵Timothee Cour2020-03-201-11/+25
| | | | | languages (#13642) Co-authored-by: narimiran
* Add isValidFilename (#13561)Juan Carlos2020-03-071-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Add os.isValidFilename * Add os.isValidFilename * Peer Review Feedbacks https://github.com/nim-lang/Nim/pull/13561#discussion_r388013139 * Peer Review Feedbacks https://github.com/nim-lang/Nim/pull/13561#issuecomment-595259568 * Add since to const * Update the documentation comment * Update the changelog * Update lib/pure/os.nim Co-Authored-By: Dominik Picheta <dominikpicheta@googlemail.com> * Update lib/pure/os.nim Co-Authored-By: Dominik Picheta <dominikpicheta@googlemail.com> * Peer Review Feedbacks, Add more Tests Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
* fix #13579 joinPath("/foo/", "../a") is now /a (#13586)Andreas Rumpf2020-03-051-0/+1
|
* fix #13455 ; joinPath(a,b) now honors trailing slashes in b (or a if b = "") ↵Timothee Cour2020-02-261-13/+19
| | | | | | | (#13467) * fix #13455 ; joinPath(a,b) now honors trailing slashes in b (or a if b = "") * fix test windows
* fix 3 minor bugs in joinPath (see #13455) (#13462) [backport]Andrey Makarov2020-02-231-1/+2
|
* relativePath("foo", "foo") is now ".", not "" (#13452)Timothee Cour2020-02-221-3/+14
|
* refs #8391 std/os now shows runtime context for raiseOSError exceptions (#13294)Timothee Cour2020-01-301-52/+51
| | | | | | | | * refs #8391: fix errmsg for setCurrentDir * raiseOSError calls for copyFile * refs #8391 std/os now shows runtime context for raiseOSError exceptions
* csize => csize_t for sysctlTimothee Cour2020-01-281-3/+3
|
* fix lots of bugs with parentDir, refs #8734 (#13236)Timothee Cour2020-01-231-14/+23
|
* new os.isRelativeTo (#13212)Timothee Cour2020-01-231-0/+12
|
* fix #13211 relativePath("foo", ".") (#13213)Timothee Cour2020-01-211-0/+2
|
* times: toUnixFloat, fromUnixFloat (#13044)Timothee Cour2020-01-181-1/+1
|
* export normalizePathEnd (#13152)Timothee Cour2020-01-151-0/+9
|