summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixFile.c
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate various unnecessary type casts, use function typedefs whenever ↵nijtmans2010-06-211-4/+4
| | | | | possible FossilOrigin-Name: 8086293cfcc9a1df3403ec3bb318d43ca99209ea
* Move TCHAR fallback typedef from tcl.h to tclPlatDecls.h (as suggested by dgp)nijtmans2010-04-221-5/+5
| | | | | | Eliminate various unnecessary type casts. FossilOrigin-Name: 77d22c7b43802be11238dcc3c0bb21ad11e74e33
* Fix gcc warning: ignoring return value of ‘write’,nijtmans2009-12-161-2/+2
| | | | | | | | declared with attribute warn_unused_result CONSTify functions TclpGetUserHome and TclSetPreInitScript (TIP #27) FossilOrigin-Name: e52afe7fa4a7ade909410cfb737f1f7bbe6c201a
* Stop calling endpwent() and endgrent(); unneeded. [Bug 1942222]dkf2009-08-021-4/+2
| | | FossilOrigin-Name: 2272f042f27238727bc8b410700daa099edb2b6f
* - eliminate some unnessary type castsnijtmans2009-02-031-3/+4
| | | | | | | - some internal const decorations - spacing FossilOrigin-Name: 4ad5e07e8ede6030f3761fe757be48b382755be1
* Get rid of pre-C89-isms (esp. CONST vs const).dkf2008-04-271-147/+160
| | | FossilOrigin-Name: 2d205c22fbe5def21ccd36bc6f7b2d3831f6122d
* merge stable branch onto HEADdgp2007-12-131-1/+1
| | | FossilOrigin-Name: d1f7550cd9bf1343d8505fb99fc5141b58bb88bf
* coverity id 100das2007-09-171-4/+4
| | | FossilOrigin-Name: b396c27797d460769f0db117b09f5106bd05c4b8
* fixed [ 1548263 ] NULL return from Tcl_FSGetNormalizedPath segvcoldstore2006-08-291-1/+4
| | | FossilOrigin-Name: 349a10088f4b234db489609ddf5473c248f2a0c4
* added check for NULL return value of Tcl_FSGetTranslatedPath(), coverity bug 39das2006-03-251-1/+4
| | | FossilOrigin-Name: 826f64eb339d8e43d8a9cc3e1ecff69eb78a9454
* * generic/tclInt.decls: implement globbing for HFS creator & typedas2006-03-211-11/+80
| | | | | | | | | | | * macosx/tclMacOSXFCmd.c: codes and 'hidden' flag, as documented in * tests/macOSXFCmd.test: glob.n; objectified OSType handling in [glob] * unix/tclUnixFile.c: and [file attributes]; fix globbing for hidden files with pattern==NULL arg. [Bug 823329] * generic/tclIntPlatDecls.h: * generic/tclStubInit.c: make genstubs FossilOrigin-Name: c72a1b963bebae88298ba81a6d1a67515c913790
* More bits of ANSIfyingdkf2005-11-111-56/+59
| | | FossilOrigin-Name: 884b0bcef26231ce020528ecb037336516222c6e
* allow NULL interp in Tcl_FSMatchInDirectoryvincentdarley2005-08-311-5/+7
| | | FossilOrigin-Name: 5139fcec81092f6d0fbdcccc79baeab183f41857
* Getting more systematic about styledkf2005-07-201-224/+274
| | | FossilOrigin-Name: 0c5cea4d810d972d3fc068b559c281718525451f
* * generic/tclUtil.c: Updated Tcl_GetNameOfExecutable() todgp2004-12-011-25/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclEncoding.c: make use of a ProcessGlobalValue for * generic/tclEvent.c: storing the executable name. Added internal routines Tcl(Get|Set)ObjNameOfExecutable() to access that storage in Tcl_Obj, rather than string format. * unix/tclUnixFile.c: Rewrote TclpFindExecutable() to use * win/tclWinFile.c: TclSetObjNameOfExecutable to store the executable name it computes. * generic/tclInt.h: Added internal stub entries for * generic/tclInt.decls: TclpFindExecutable and Tcl(Get|Set)ObjNameOfExecutable. * generic/tclIntDecls.h: make genstubs * generic/tclStubInit.c: * generic/tclCmdIL.c: Retrieve executable name in Tcl_Obj form * win/tclWinPipe.c: instead of string form. * unix/tclUnixTest.c: Update [testfindexecutable] command to use new internal interfaces. FossilOrigin-Name: 353036774ea2c180f427a71ae6bbd7812a6e45d2
* Patch 976520 reworks several of the details involved withdgp2004-11-301-18/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | startup/initialization of the Tcl library, focused on the activities of Tcl_FindExecutable(). * generic/tclIO.c: Removed bogus claim in comment that encoding "iso8859-1" is "built-in" to Tcl. * generic/tclInt.h: Created a new struct ProcessGlobalValue, * generic/tclUtil.c: routines Tcl(Get|Set)ProcessGlobalValue, and function type TclInitProcessGlobalValueProc. Together, these take care of the housekeeping for "values" (things that can be held in a Tcl_Obj) that are global across a whole process. That is, they are shared among multiple threads, and epoch and mutex protection must govern the validity of cached copies maintained in each thread. * generic/tclNotify.c: Modified TclInitNotifier() to tolerate being called multiple times in the same thread. * generic/tclEvent.c: Dropped the unused argv0 argument to TclInitSubsystems(). Removed machinery to unsure only one TclInitNotifier() call per thread, now that that is safe. Converted Tcl(Get|Set)LibraryPath to use a ProcessGlobalValue, and moved them to tclEncoding.c. * generic/tclBasic.c: Updated caller. * generic/tclInt.h: TclpFindExecutable now returns void. * unix/tclUnixFile.c: * win/tclWinFile.c: * win/tclWinPipe.c: * generic/tclEncoding.c: Built new encoding search initialization on a foundation of ProcessGlobalValues, exposing new routines Tcl(Get|Set)EncodingSearchPath. A cache of a map from encoding name to directory pathname keeps track of where encodings are available for loading. Tcl_FindExecutable greatly simplified into just three function calls. The "library path" is now misnamed, as its only remaining purpose is as a foundation for the default encoding search path. * generic/tclInterp.c: Inlined the initScript that is evaluated by Tcl_Init(). Added verification after initScript evaluation that Tcl can find its installed *.enc files, and that it has initialized [encoding system] in agreement with what the environment expects. [tclInit] no longer driven by the value of $::tcl_libPath; it largely constructs its own search path now, rather than attempt to share one with the encoding system. * unix/tclUnixInit.c: TclpSetInitialEncodings factored so that a new * win/tclWinInit.c: routine TclpGetEncodingNameFromEnvironment can reveal that Tcl thinks the [encoding system] should be, even when an incomplete encoding search path, or a missing *.enc file won't allow that initialization to succeed. TclpInitLibraryPath reworked as an initializer of a ProcessGlobalValue. * unix/tclUnixTest.c: Update implementations of [testfindexecutable], [testgetdefenc], and [testsetdefenc]. * tests/unixInit.test: Corrected tests to operate properly even when a value of TCL_LIBRARY is required to find encodings. * generic/tclInt.decls: New internal stubs: TclGetEncodingSearchPath, TclSetEncodingSearchPath, TclpGetEncodingNameFromEnvironment. These are candidates for public exposure by future TIPs. * generic/tclIntDecls.h: make genstubs * generic/tclStubInit.c: * generic/tclTest.c: Updated [testencoding] to use * tests/encoding.test: Tcl(Get|Set)EncodingSearchPath. Updated tests. FossilOrigin-Name: 5b205fd672e4cd2530d67359acc45f14ffd57e60
* filesystem generic/platform code splittingvincentdarley2004-10-071-1/+128
| | | FossilOrigin-Name: 60716a23e9f5c5f0e1e02caa3de634fbd0080f6a
* * unix/tclUnixFile.c (NativeMatchType): added support fordas2004-07-201-1/+5
| | | | | | readonly matching of user immutable files (where available). FossilOrigin-Name: efbebac2116811d8fe359c939edd8220336e679e
* * generic/tclEncoding.c: Static TclFindEncodings -> FindEncodings.dgp2004-06-181-2/+3
| | | | | | | | | * generic/tclInt.h: Updated TclpFindExecutable() so that failed * generic/tclUtil.c: attempts to find the executable are saved * unix/tclUnixFile.c: just as successful finds are. [Patch 966053] * unix/tclUnixTest.c: FossilOrigin-Name: 7cbe86f3c9ffdb9cf1753f2f3e624ce112adc7f4
* Patch 922727 committed. Implements three changes:dgp2004-04-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclInt.h: Reworked the Tcl header files into a clean * unix/tclUnixPort.h: hierarchy where tcl.h < tclPort.h < tclInt.h * win/tclWinInt.h: and every C source file should #include * win/tclWinPort.h: at most one of those files to satisfy its declaration needs. tclWinInt.h and tclWinPort.h also better organized so that tclWinPort.h includes the Windows implementation of cross-platform declarations, while tclWinInt.h makes declarations that are available on Windows only. * generic/tclBinary.c (TCL_NO_MATH): Deleted the generic/tclMath.h * generic/tclMath.h (removed): header file. The internal Tcl * macosx/Makefile (PRIVATE_HEADERS): header, tclInt.h, has a * win/tcl.dsp: #include <math.h> directly, and file external to Tcl needing libm should do the same. * win/Makefile.in (WIN_OBJS): Deleted the win/tclWinMtherr.c file. * win/makefile.bc (TCLOBJS): It's a vestige from matherr() days * win/makefile.vc (TCLOBJS): gone by. * win/tcl.dsp: * win/tclWinMtherr.c (removed): FossilOrigin-Name: 2e5b18c85c944b46540edfdd6580648e32645e2b
* filesystem fixes for '-force' consistency and picky compilersvincentdarley2004-01-291-1/+6
| | | FossilOrigin-Name: fff97fe11686fd45ff17aebdd91fb6c89fd9498a
* filesystem optimisation -- Three main issues accomplished: (1) cleaned up ↵vincentdarley2004-01-211-21/+53
| | | | | variable names in FossilOrigin-Name: 9cfcca63fb07d8c7d68befc16d84d01790094ac5
* fix to file normalization with relative linksvincentdarley2003-12-171-11/+47
| | | FossilOrigin-Name: b69743eda9ee9351ceeb7e81c6c3e91aff5cc88e
* allow creation of relative linksvincentdarley2003-12-121-3/+24
| | | FossilOrigin-Name: 60f9fa8b4d7c9186b4090309b0add0ed492b362a
* free path when no longer neededvincentdarley2003-11-031-1/+2
| | | FossilOrigin-Name: 5e80e5abd3c9c987730b6484d8fe5a5a6e22c75f
* filesystem bug fixesvincentdarley2003-10-131-3/+10
| | | FossilOrigin-Name: f53be6ca932d75224f711710f48a99d73b1803f4
* glob -l on broken symlink fixvincentdarley2003-02-121-2/+14
| | | FossilOrigin-Name: be22ec9c7965c67002d4e998fc2b4e58fe9db82f
* * unix/tclUnixFile.c (TclpMatchInDirectory): simplify the hiddenhobbs2003-02-111-24/+14
| | | | | | file match check. FossilOrigin-Name: 5ac811df840c62d421c871c4dcd6c4fccc72a46b
* filesystem speed up round 2vincentdarley2003-02-101-58/+36
| | | FossilOrigin-Name: 1f9c0e4f03a1887a627fd66e6affceebf25f9519
* non-ascii chars in file mtime fixvincentdarley2003-01-091-1/+24
| | | FossilOrigin-Name: f53b3ba4dad59d84f37be2a959429127c30f8536
* * unix/tclUnixFile.c (TclpObjLink): removed unnecessary/unfreedhobbs2002-09-031-13/+4
| | | | | | extra native char*. FossilOrigin-Name: 231e743416c6052a1926ccfe709c96a496c28c6b
* vfs fixesvincentdarley2002-07-201-4/+8
| | | FossilOrigin-Name: 9e7220513241fca16eeedd8161a57e97868f395d
* Global symbols are now all either prefixed with 'tcl' (or 'Tcl' or ...) or ↵dkf2002-07-191-4/+2
| | | | | have file-scope. FossilOrigin-Name: 86e27ff753182370088914b09b67faefe53a8d37
* Changed all the Tcl_Platform* symbols to TclOS*; they weren't public so theirdkf2002-06-281-15/+15
| | | | | | names were really badly chosen. Also prevented a double-#def. FossilOrigin-Name: 049b4fa9e2b895d0b8b0426cc3ec95483f99fd29
* tip99vincentdarley2002-06-211-8/+23
| | | FossilOrigin-Name: e0671d6019fef310429006d7d45b2766e15c4dbc
* vfs, winfs testsuitevincentdarley2002-06-131-5/+9
| | | FossilOrigin-Name: 494e81b676070f623d387cd1d1104b404dba7803
* Made this file compile!dkf2002-06-121-2/+4
| | | FossilOrigin-Name: 0814d34f8df4970c923cb6bfdbfef3589d1d619e
* fs clarification and windows fixesvincentdarley2002-06-121-7/+19
| | | FossilOrigin-Name: cf698404c4b6fd12d867d791276e08b4ab471c11
* fix to 551306vincentdarley2002-05-021-1/+28
| | | FossilOrigin-Name: 34f2d6b9b0d26247061284641dd6ecddda35a5ca
* 4 fs fixesvincentdarley2002-03-241-196/+219
| | | FossilOrigin-Name: d33368661952a4384e657612e1b3b49a2bd6b278
* TIP#72 implementation. See ChangeLog for details.dkf2002-02-151-25/+19
| | | | | | | This version builds clean on Solaris/SPARC, with GCC and CC, both with and without threads and both in 32-bit and 64-bit mode. FossilOrigin-Name: 8d82de1905ada4c5d06f5fb967721e8b681b7c82
* * djgpp/ (new directory)davygrvy2002-02-121-3/+12
| | | | | | | | | | | | | | | | | * djgpp/Makefile (new): * unix/tclAppInit.c: * unix/tclMtherr.c: * unix/tclUnixFCmd.c: * unix/tclUnixFile.c: * unix/tclUnixInit.c: * unix/tclUnixPort.h: Early stage of DJGPP support for building Tcl on DOS. Dynamic loading isn't working, yet. Requires watt32 for the TCP/IP stack. No autoconf, yet. Barely tested, but makes a working exe that runs Tcl in protected-mode, flat memory. [exec] and pipes will need the most work as multi-tasking on DOS has to be carefully. FossilOrigin-Name: 58a026b69c9d29a1332cd0f3a87386fdcf5f240f
* * Partial TIP 27 rollback. Following routinesdgp2002-02-081-5/+3
| | | | | | | | | | | | | | | restored to return (char *): Tcl_DStringAppend, Tcl_DStringAppendElement, Tcl_JoinPath, Tcl_TranslateFileName, Tcl_ExternalToUtfDString, Tcl_UtfToExternalDString, Tcl_UniCharToUtfDString, Tcl_GetCwd, Tcl_WinTCharToUtf. Also restored Tcl_WinUtfToTChar to return (TCHAR *) and Tcl_UtfToUniCharDString to return (Tcl_UniChar *). Modified some callers. This change recognizes that Tcl_DStrings are de-facto white-box objects. * generic/tclCmdMZ.c: corrected use of C++-style comment. FossilOrigin-Name: bb1a244cde9f05a5477cf5dd8e8ab44cd978459f
* * Updated interfaces of generic/tclEncoding, generic/tclFilename.c,dgp2002-01-251-7/+7
| | | | | | | | | | | | | generic/tclIOUtil.c, generic/tclPipe.c, generic/tclResult.c, generic/tclUtil.c, generic/tclVar.c and mac/tclMacResource.c according to TIP 27. Tcl_TranslateFileName rewritten as wrapper around VFS-aware version. Updated callers. ***POTENTIAL INCOMPATIBILITY*** Includes source incompatibilities: argv arguments of Tcl_Concat, Tcl_JoinPath, Tcl_OpenCommandChannel, Tcl_Merge; argvPtr arguments of Tcl_SplitList and Tcl_SplitPath. FossilOrigin-Name: fceed15544ad472b748cdf463c3b4005e83b5e8f
* * More TIP 27 updates in tclIOUtil.c and tclIndexObj.c that weredgp2002-01-171-5/+5
| | | | | | | | | overlooked before. Updated callers. ***POTENTIAL INCOMPATIBILITY*** Includes a source incompatibility in the tablePtr arguments of the Tcl_GetIndexFromObj* routines. FossilOrigin-Name: 28b6020550dd9e62f46b824e4c2ba2a6302657f6
* Fix for bug 475941; access() was being called with path-free file names ondkf2001-10-291-5/+4
| | | | | | some paths through the glob code! FossilOrigin-Name: 436be4a498d009da65dab117b2294c6b70c7d4c5
* filesystemvincentdarley2001-08-301-136/+88
| | | FossilOrigin-Name: 63ee4e7a09d028fa707389d63a2bdc197a342ce1
* fs updatevincentdarley2001-08-231-49/+72
| | | FossilOrigin-Name: 37484c1daabf6ee673956b20a5839e2ba4d36684
* Changes from TIP#17 "Redo Tcl's filesystem"vincentdarley2001-07-311-136/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following files were impacted. * doc/Access.3: * doc/FileSystem.3: * doc/OpenFileChnl.3: * doc/file.n: * doc/glob.n: * generic/tcl.decls: * generic/tcl.h: * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclDate.c: * generic/tclDecls.h: * generic/tclEncoding.c: * generic/tclFCmd.c: * generic/tclFileName.c: * generic/tclGetDate.y: * generic/tclIO.c: * generic/tclIOCmd.c: * generic/tclIOUtil.c: * generic/tclInt.decls: * generic/tclInt.h: * generic/tclIntDecls.h: * generic/tclLoad.c: * generic/tclStubInit.c: * generic/tclTest.c: * generic/tclUtil.c: * library/init.tcl: * mac/tclMacFCmd.c: * mac/tclMacFile.c: * mac/tclMacInit.c: * mac/tclMacPort.h: * mac/tclMacResource.c: * mac/tclMacTime.c: * tests/cmdAH.test: * tests/event.test: * tests/fCmd.test: * tests/fileName.test: * tests/io.test: * tests/ioCmd.test: * tests/proc-old.test: * tests/registry.test: * tests/unixFCmd.test: * tests/winDde.test: * tests/winFCmd.test: * unix/mkLinks: * unix/tclUnixFCmd.c: * unix/tclUnixFile.c: * unix/tclUnixInit.c: * unix/tclUnixPipe.c: * win/tclWinFCmd.c: * win/tclWinFile.c: * win/tclWinInit.c: * win/tclWinPipe.c FossilOrigin-Name: 9461aca54800a289624dfe39d333e41e20168ac3
* * unix/tclUnixFile.c: fixed signature style on functionshobbs2000-01-111-16/+16
| | | | | | | | * unix/Makefile.in: made sure tcl.m4 would be installed with dist * unix/tcl.m4: added ELF support for NetBSD [Bug: 3959] FossilOrigin-Name: 341792a1e80465bc745c10180dd11adc3a65bcd0