Commit graph

181 commits

Author SHA1 Message Date
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
Araq
fde16e6c3e fixes os.moveFile on Windows 2015-02-13 01:39:20 +01:00
Araq
10335fd726 fixed minor bugs; cleaned up tests 2015-02-12 14:56:56 +01:00
Araq
e84834db79 lots of C++ codegen improvements 2015-02-07 10:48:07 +01:00
Araq
26b853923c nimsuggest: first version 2015-01-27 01:36:19 +01:00
Guillaume Gelin
3119fe087d Happy new year! 2015-01-06 15:26:33 +01:00
Araq
4144b2d867 fixes #685 2014-12-26 02:23:11 +01:00
Araq
24e66e04fa cleaned up os.nim; docgen improvements 2014-12-21 14:28:46 +01:00
Araq
b131439a2a fixes #1735 2014-12-15 02:21:44 +01:00
Araq
81f013dabb fixes #642 2014-11-23 16:07:25 +01:00
Araq
fc47c0edc7 Merge branch 'devel' of https://github.com/Araq/Nimrod into bigbreak
Conflicts:
	lib/impure/db_postgres.nim
	lib/pure/os.nim
	lib/wrappers/postgres.nim
2014-10-04 19:40:23 +02:00
Reimer Behrends
d0b292b466 Fix permissions for createDir() on Unix systems.
Permissions were set to 0o711 by default; they should be 0o777, with
umask being responsible for restricting permissions further.
2014-09-22 23:18:14 +02:00
Dominik Picheta
6f155af802 Lots of documentation improvements for asyncdispatch.
Ref #1487.
2014-09-12 22:54:02 +01:00