Commit graph

193 commits

Author SHA1 Message Date
cheatfate
c21bc6c61c Fix for getCurrentDir().
Fix for expandFilename().
Fix for getAppFilename().
2016-10-23 16:41:04 +03:00
Simon Ruderich
fc0a3dceaf os: always use pcLinkToDir as kind for links to directories
Only the OS-specific case in walkDir() handled that correctly. Adapt the
general case and handle it in getFileInfo().
2016-09-17 18:32:45 +02:00
Simon Ruderich
21433477df os: createHardlink: clarify documentation
I know no (UNIX-like) system which restricts creation of hardlinks.
2016-09-15 04:20:45 +02:00
Simon Ruderich
4f1886621e os: createSymlink: fix typo in documentation 2016-09-15 04:20:24 +02:00
Araq
6a1b8e691f fixes #4764, fixes #4731, fixes #4724 2016-09-14 19:59:32 +02:00
Araq
3a3aeb94ec minor stdlib cleanups 2016-09-09 20:41:26 +02:00
Andreas Rumpf
f1092512e3 tiny style changes 2016-08-09 14:16:26 +02:00
Andreas Rumpf
8876ed23f1 expr and stmt are now deprecated 2016-07-30 16:34:42 +02:00
Andreas Rumpf
60b187513e stdlib and compiler don't use .immediate anymore 2016-07-29 23:51:01 +02:00
Hans Raaf
e412e5458c Small changes to the docs to make it easier to find stuff. 2016-07-21 20:09:33 +02:00
Andreas Rumpf
0834cd63d9 prepare Nim codebase for upcoming parser changes 2016-07-15 12:56:03 +02:00
Vladislav Vorobiev
e4b16ac608 Remove line breaks in OSError messages (Windows)
Before:
```
Error: unhandled exception: Не удается найти указанный файл.
 [OSError]
```
After:
```
Error: unhandled exception: Не удается найти указанный файл.  [OSError]
```
2016-07-01 21:50:26 +03:00
Joey Payne
02895ba934 Add walkPattern to return both files and directories
Also added `walkDirs` to walk only directories based on the pattern
specified.
2016-06-17 08:35:59 -06:00
Joey Payne
b5f1a82285 Fix #4280: os.walkFiles yields directories on Unix systems
Files were not properly checked to actually be files after globbing.
2016-06-16 14:30:46 -06:00
Jacek Sieka
087db3ce64 remove fauly fix for windows error being overwritten 2016-06-12 14:31:59 +08:00
Jacek Sieka
43996c24a0 fix errno in os.nim 2016-06-08 23:28:16 +08:00
Jacek Sieka
fe2b39f007 remove system/ansi_c include from os 2016-06-05 20:16:26 +08:00
Jacek Sieka
64b0485207 fix types of ansi_c/sysio to more closely match C ABI
also fixes some instances of using C library functions when there are
nim alternatives available
2016-06-05 12:03:20 +08:00
coffeepots
d9ed61fa62 Deprecate timeToTimeInfo, add str->time procs
* depreciate timeToTimeInfo, add str->time procs

initTime allows creating times from strings. initTimeFromStr offers a default format string compatible with $Time.
timeToTimeInterval changed to work properly.

* Spell {.deprecated.} correctly

* deprecated timeToTimeInfo, removed initTime procs

Is it even worth depreciating timeToTimeInfo rather than just removing it, considering it's just wrong and we have getLocalTime and getGMTime that actually work? Also, if I'm renaming timeToTimeInfo -> toTimeInfo etc, isn't the deprecated tag kind of redundant?

* Updated names for toTime and toTimeInterval procs

* Added type to toTime template

This should allow compilation of os.nim now that toTime is defined in times.nim.

* Updated toTime template to use {.gensym.}

Local templates default to 'bind' semantics, not 'gensym'. This was causing a failure to 'see' the local toTime template.
2016-04-06 10:36:17 +01:00
Dominik Picheta
442a682c33 Better additionalInfo OSError message, ref #2650. 2016-04-04 14:44:26 +01:00
def
e6dfadf55d Use /proc/self/exe on NetBSD 2016-03-07 02:13:35 +01:00
def
4b1e3f26a7 Better getAppFilename() heuristic for OpenBSD and NetBSD
Using the environment variable _ is completely broken and makes it
impossible to build even nimble. After calling `sh` (ksh) on OpenBSD,
`_` is wrongly set to `/bin/sh` and all subprocess calls to Nim fail.
2016-03-07 02:12:44 +01:00
Yuriy Glukhov
dca3daf4d4 Avoid using private _NSGetEnviron API on iOS. 2016-03-05 14:18:36 +02:00
Pavel Roschin
17dff030ae Use defer in iterator to avoid possible leaks. Fixes #3802 2016-02-02 23:20:39 +03:00
Araq
22ed2aab35 fixes memory leak for getAppFilename on Windows 2015-11-26 21:20:10 +01:00
Araq
2aff716134 os.walkDir is available at compile time 2015-11-10 15:31:21 +01:00
Araq
c852143f3a os.walkDir supports yielding relative paths 2015-09-29 19:30:44 +02:00
Araq
178275f494 split os into os and ospaths parts; ospaths is available for NimScript; better NimScript support 2015-09-04 12:22:23 +02:00
Dominik Picheta
fe190ee83f Better docs for os.getCreationTime(). Fixes #1058. 2015-08-23 19:57:23 +01:00
Araq
d81578cb9b workaround windows 'findNextFile' bug 2015-08-16 13:41:28 +02:00
Araq
27f5c3ceb9 added os.tailDir proc 2015-07-12 13:33:22 +02:00
Dominik Picheta
a312808e38 Do not use errno on Windows in the `os` module. 2015-07-11 14:01:53 +01:00
Sloane Simmons
b124b8b4bb Use raiseOSError with additionalInfo parameter from devel 2015-07-04 09:29:37 -05:00
Dominik Picheta
e0497112dc Remove expandTilde forward declaration 2015-07-03 00:37:42 +01:00
Araq
5fcb7ca313 True is true 2015-06-30 12:20:01 +02:00
Dominik Picheta
8ef0d9386b Implements `os.expandSymlink`. Ref #3015. 2015-06-29 21:39:45 +01:00
Araq
2297a1aa60 much better error message if an exe cannot be found 2015-06-29 02:48:31 +02:00
Vlad
059b05a804 fixed #1985 2015-06-14 21:42:43 +03:00
Araq
ccb9ae2d52 stdlib: don't use deprecated symbols 2015-06-04 13:18:42 +02:00
pdw
6914244f30 lib/pure/e-o - Dropped 'T' from types 2015-06-04 13:18:35 +02:00
Reimer Behrends
28dd0407bb Fix behavior of os.getFileInfo() for symbolic links.
The calls to lstat() and stat() were switched. As a result,
links weren't followed for followLink == true and links were
followed for followLink == false.
2015-05-13 12:26:34 +02:00
Grzegorz Adam Hankiewicz
1320efcf90 Excludes windows platfrom from $PATH tilde expansion. Refs #2358. 2015-03-17 20:07:20 +01:00
Grzegorz Adam Hankiewicz
79934b9d68 Expands tildes for entries in $PATH when looking for a binary. 2015-03-16 22:01:56 +01:00
Grzegorz Adam Hankiewicz
ff94ce9d0b Enables use of NSGetEnviron for osx binary compatibility. Refs #965. 2015-03-14 21:35:33 +01:00
def
d198e397fd Check that file passed to getFileInfo is not nil 2015-03-10 15:24:20 +01:00
def
5e8eaa5f97 Use faster walkDir on BSDs 2015-02-24 23:39:08 +01:00
def
34d87c105c Fall back to lstat() calls on unsupported filesystems 2015-02-24 23:31:31 +01:00
def
1adebdc767 Speed up walkDir significantly
We only know that this works on Linux and Mac OS X, so other systems use
the POSIX conforming version still. This removed the lstat call, which
is especially expensive on NFS filesystems for me.
2015-02-24 16:37:54 +01:00
Federico Ceratto
657dca5c3b Fix typos 2015-02-15 16:20:32 +00:00
Federico Ceratto
c95f6f117a Fix typos 2015-02-15 16:06:06 +00:00