aboutsummaryrefslogtreecommitdiffstats
path: root/lib/System/Unix/Path.inc
Commit message (Collapse)AuthorAgeFilesLines
* Here is the bulk of the sanitizing.Gabor Greif2007-07-051-1/+1
| | | | | | | Almost all occurrences of "bytecode" in the sources have been eliminated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37913 91177308-0d34-0410-b5e6-96231b3b80d8
* pull some win32 code into common code, add bitcode identification support.Chris Lattner2007-05-061-31/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36846 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1291:Reid Spencer2007-04-071-44/+45
| | | | | | | Implement the PathWithStatus class and its use throughout lib/System. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35742 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR789:Reid Spencer2007-03-291-32/+35
| | | | | | | | | Make the sys::Path::getFileStatus function more efficient by having it return a pointer to the FileStatus structure rather than copy it. Adjust uses of the function accordingly. Also, fix some memory issues in sys::Path. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35476 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a uniqueID field to the FileStatus structure for Paths. This will mapReid Spencer2007-03-291-0/+1
| | | | | | | | to the inode number on Unix and something far less unique on Windows. The windows case needs to be improved. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35461 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR789:Reid Spencer2007-03-291-12/+22
| | | | | | | | | | * Add a method: bool isAbsolute() const, which determines if the path name is absolute or not. * Implement caching of file status information in the Path object. Allow it to be updated forcefully or lazily re-fetched from the cached value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35456 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR797:Reid Spencer2006-08-231-53/+60
| | | | | | | | Final removal of exceptions from lib/System and adjustment of users to accommodate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29846 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR797:Reid Spencer2006-08-231-34/+21
| | | | | | | | Eliminate exception throwing from Path::renamePathOnDisk and adjust its users correspondingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29843 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR797:Reid Spencer2006-08-231-5/+8
| | | | | | | Remove exception throwing from Path::getDirectoryContents and its users. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29841 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR797:Reid Spencer2006-08-231-15/+22
| | | | | | | | Remove exceptions from the Path::create*OnDisk methods. Update their users to handle error messages via arguments and result codes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29840 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR797:Reid Spencer2006-08-221-9/+18
| | | | | | | Change the Path::make*OnDisk methods exception free and adjust their usage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29836 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the sys::Path::GetTemporaryDirectory method not throw exceptions andReid Spencer2006-08-221-23/+30
| | | | | | | adjust users of it to compensate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29831 91177308-0d34-0410-b5e6-96231b3b80d8
* Make an error message a little more intelligible.Reid Spencer2006-08-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29808 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a note about how the "isFile" check in Path::eraseFromDisk preventsReid Spencer2006-08-071-0/+5
| | | | | | | the erasure of non-file paths like /dev/null. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29539 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some now-dead methods. Use getFileStatus instead.Chris Lattner2006-08-011-34/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29447 91177308-0d34-0410-b5e6-96231b3b80d8
* elimiante some syscallsChris Lattner2006-08-011-15/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29442 91177308-0d34-0410-b5e6-96231b3b80d8
* Modify setStatusInfoOnDisk to not throw an exception.Chris Lattner2006-07-281-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29402 91177308-0d34-0410-b5e6-96231b3b80d8
* Modify Path::eraseFromDisk to not throw an exception.Chris Lattner2006-07-281-24/+29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29400 91177308-0d34-0410-b5e6-96231b3b80d8
* Change Path::getStatusInfo to return a boolean and error string on an errorChris Lattner2006-07-281-15/+15
| | | | | | | | | instead of throwing an exception. This reduces the amount of code that is exposed to exceptions (e.g. FileUtilities), though it is clearly only one step along the way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29395 91177308-0d34-0410-b5e6-96231b3b80d8
* no need to do a stat then an lstat. lstat will tell us if normal files ↵Chris Lattner2006-07-071-7/+4
| | | | | | don't exist. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29068 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a problem in getDirectoryContents where sub-directory names wereReid Spencer2005-07-281-6/+14
| | | | | | | | | | appended to a path string that didn't end in a slash, yielding invalid path names. Path contribute by Nicholas Riley. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22539 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. Fix bug in getBaseName where it mishandles suffixesJeff Cohen2005-07-091-2/+6
| | | | | | | 2. Fix bug in eraseSuffix where it allows /path/.suffix to become /path/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22362 91177308-0d34-0410-b5e6-96231b3b80d8
* Ensure that functions like isDirectory don't fail if the file doesn'tReid Spencer2005-07-081-1/+13
| | | | | | | exist but just return false instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22361 91177308-0d34-0410-b5e6-96231b3b80d8
* Two changes:Reid Spencer2005-07-081-7/+11
| | | | | | | | | | | 1. Use isValid() to check validity of the resulting path name in the eraseSuffix even though we can't think of a case where eraseSuffix could possibly cause an invalid path name. 2. Rewrite isValid() to not use the deprecated realpath function any more. It now just uses isascii to make sure all the characters are legit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22359 91177308-0d34-0410-b5e6-96231b3b80d8
* Stamp out tabsJeff Cohen2005-07-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22357 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix eraseSuffix()Jeff Cohen2005-07-081-10/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22355 91177308-0d34-0410-b5e6-96231b3b80d8
* Final Changes For PR495:Reid Spencer2005-07-081-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | This chagne just renames some sys::Path methods to ensure they are not misused. The Path documentation now divides methods into two dimensions: Path/Disk and accessor/mutator. Path accessors and mutators only operate on the Path object itself without making any disk accesses. Disk accessors and mutators will also access or modify the file system. Because of the potentially destructive nature of disk mutators, it was decided that all such methods should end in the work "Disk" to ensure the user recognizes that the change will occur on the file system. This patch makes that change. The method name changes are: makeReadable -> makeReadableOnDisk makeWriteable -> makeWriteableOnDisk makeExecutable -> makeExecutableOnDisk setStatusInfo -> setStatusInfoOnDisk createDirectory -> createDirectoryOnDisk createFile -> createFileOnDisk createTemporaryFile -> createTemporaryFileOnDisk destroy -> eraseFromDisk rename -> renamePathOnDisk These changes pass the Linux Deja Gnu tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22354 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR495:Reid Spencer2005-07-071-130/+79
| | | | | | | | | | | | | | | | | | | | | | Get rid of the difference between file paths and directory paths. The Path class now simply stores a path that can refer to either a file or a directory. This required various changes in the implementation and interface of the class with the corresponding impact to its users. Doxygen comments were also updated to reflect these changes. Interface changes are: appendDirectory -> appendComponent appendFile -> appendComponent elideDirectory -> eraseComponent elideFile -> eraseComponent elideSuffix -> eraseSuffix renameFile -> rename setDirectory -> set setFile -> set Changes pass Dejagnu and llvm-test/SingleSource tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22349 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR495:Reid Spencer2005-07-071-6/+6
| | | | | | | | | | | | Change interface to Path class: readable -> canRead writable -> canWrite executable -> canExecute More (incremental) changes coming to close 495. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22345 91177308-0d34-0410-b5e6-96231b3b80d8
* Put in a hack for Cygwin that prevents mkdtemp from being used sinceReid Spencer2005-06-021-0/+5
| | | | | | | configure seems to find it on Cygwin but linking against it fails. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22189 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove vim settings from source code; people should use llvm/utils/vim/vimrcMisha Brukman2005-05-051-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21704 91177308-0d34-0410-b5e6-96231b3b80d8
* For Bug 543:Reid Spencer2005-04-211-24/+24
| | | | | | | | | Standardize the error messages to be in "path: what failed: why" format. Also attempt to use the correct errno to ThrowErrno in situations where the errno value is erased by subsequent system calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21385 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not mark directories as `executable', we only want program filesMisha Brukman2005-04-201-0/+4
| | | | | | | Patch by Markus Oberhumer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21377 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore dangling symlinks in getDirectoryContents()Misha Brukman2005-04-201-3/+8
| | | | | | | Thanks to Markus Oberhumer for the patch! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21370 91177308-0d34-0410-b5e6-96231b3b80d8
* Be slightly more accurate in an error message.Reid Spencer2005-03-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20397 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-271-1/+25
| | | | | | | | * Ensure #includes are wrapped with appropriate HAVE_ guards * Ensure variations in "dirent" structure are accounted for. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19158 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-241-0/+89
| | | | | | | | | Merge implementations of isValid and GetTemporaryDirectory into this file. There is not any point having the operating system specific files for such little variation between the Unix family of systems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19134 91177308-0d34-0410-b5e6-96231b3b80d8
* Put the CopyFile function explicitly in the sys namespace.Reid Spencer2004-12-211-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19079 91177308-0d34-0410-b5e6-96231b3b80d8
* * Use "" for LLVM include files, not <>Misha Brukman2004-12-201-5/+3
| | | | | | | | * llvm/Config/alloca.h already #includes config.h * Minor readability/stylistic changes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19048 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the signatures of the destroyFile and destroyDirectory methods toReid Spencer2004-12-151-2/+2
| | | | | | | const because they affect the file system, not the Path object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18973 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove automatic insertion of CFE's lib directory into the bytecode pathReid Spencer2004-12-151-7/+0
| | | | | | | because LLVM should be agnostic to the needs of specific front ends. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18968 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a file overwrite bug in llvm-ar introduced by changes toReid Spencer2004-12-151-4/+4
| | | | | | | | | | | createTemporaryFile semantics where it doesn't create a fully unique name if the basename doesn't exist. This functionality is now optionally provided by the boolean reuse_current parameter to createTemporaryFile and makeUnique. The default values differ because of the way these functions are used in LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18961 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-151-21/+99
| | | | | | | | | | * Fix implementation and documentation about LLVMGCCDIR/bytecode-libs * Add the makeUnique method, replacement for getUniqueFilename in Support. * Add the sys::CopyFile function, replacement for CopyFile in Support. * Move GetLLVMConfigDir() into generic code area since its generic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18947 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-131-0/+36
| | | | | | | | | | | Implement three new functions to allow setting access/permission bits on the file referenced by a path. The makeReadable and makeExecutable methods replace the FileUtilities MakeFileReadable and MakeFileExecutable functions. The makeWritable function is new and provided for consistency since Path has a writable() method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18907 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an always false clause from an if statement.Reid Spencer2004-12-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18885 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug where directory names of length one or less where not setAlkis Evlogimenos2004-12-131-1/+1
| | | | | | | properly (examples: "", ".", "a"). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18883 91177308-0d34-0410-b5e6-96231b3b80d8
* * Add a std::ostream inserter for sys::PathReid Spencer2004-12-131-1/+1
| | | | | | | * Correct the std::string constructor to take a const reference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18877 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351: \Reid Spencer2004-12-131-67/+54
| | | | | | | | | * Remove IsLibrary and GetLibraryPath, replaced by FindLibrary in ../Path.cpp \ * Implement GetSystemLibraryPaths and GetBytecodeLibraryPaths, instead of the \ GetSystemLibraryPath1 and GetSystemLibraryPath2 methods git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18862 91177308-0d34-0410-b5e6-96231b3b80d8
* Path::get -> Path::toStringReid Spencer2004-12-111-6/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18785 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix seriously broken implementation of GetMagicNumber.Reid Spencer2004-12-021-4/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18422 91177308-0d34-0410-b5e6-96231b3b80d8