summaryrefslogtreecommitdiffstats
path: root/base/file_util.h
Commit message (Collapse)AuthorAgeFilesLines
* Implement DownloadFile::Rename() for posix. Downloads work on linux!estade@chromium.org2009-03-131-1/+3
| | | | | | Review URL: http://codereview.chromium.org/46020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11659 0039d316-1c4b-4281-b951-d872f2087c98
* file_util::Move fails on Windows if moving a directoryhuanr@chromium.org2009-03-111-0/+6
| | | | | | | | | | | across volumes. This change adds a CopyAndDeleteDirectory function, and Move falls back to CopyAndDeleteDirectory if moving directory fails. BUG=8505 Review URL: http://codereview.chromium.org/43069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11460 0039d316-1c4b-4281-b951-d872f2087c98
* Properly honor base::SharedMemory semantics for name="" to meanjrg@chromium.org2009-02-041-0/+12
| | | | | | | | | | | | new/private shared memory on POSIX. Transition base::SharedMemory implementation to file/mmap() to prevent leaking of wired kernel resources and allow easier cleanup. Enable one more shared_memory unit test for POSIX. Enable stats_table_unittest.cc for Mac, and modify it so it cleans up. Review URL: http://codereview.chromium.org/19724 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9114 0039d316-1c4b-4281-b951-d872f2087c98
* Safe browsing cleanup:estade@chromium.org2009-01-281-0/+4
| | | | | | | | | * wstring -> FilePath * create versions of WriteFile/ReadFile with FilePath signatures Review URL: http://codereview.chromium.org/19610 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8797 0039d316-1c4b-4281-b951-d872f2087c98
* Add FilePath version of ReadFileToString.erikkay@google.com2009-01-281-0/+2
| | | | | | Review URL: http://codereview.chromium.org/19401 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8774 0039d316-1c4b-4281-b951-d872f2087c98
* Roll forward 8722,8721jeremy@chromium.org2009-01-271-0/+17
| | | | | | Review URL: http://codereview.chromium.org/19028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8734 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 8722,8721.maruel@chromium.org2009-01-271-17/+0
| | | | | | Review URL: http://codereview.chromium.org/19024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8723 0039d316-1c4b-4281-b951-d872f2087c98
* First step of porting VisitedLinkMaster to POSIX:jeremy@chromium.org2009-01-271-0/+17
| | | | | | | | | | | | * Use POSIX file access APIs rather than HANDLEs. * Add stubs so that VisitedLinkMaster compiles on POSIX. Still to be done: * Bring up Surrounding infrastructure to turn on unit tests. Review URL: http://codereview.chromium.org/18530 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8721 0039d316-1c4b-4281-b951-d872f2087c98
* Move Contains() method to file_utils, stop relying on in extensions_protocolaa@chromium.org2009-01-091-4/+3
| | | | | | Review URL: http://codereview.chromium.org/16805 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7841 0039d316-1c4b-4281-b951-d872f2087c98
* Add implementations of various extension related methods (derived from ↵erikkay@google.com2009-01-091-13/+9
| | | | | | | | | | | | file_util): Extension, RemoveExtension, InsertBeforeExtension, ReplaceExtension I didn't reimplement the old file_util ones since they actually modify the FilePath in place, which isn't the style of the rest of the FilePath methods. I'll file a cleanup bug after this for callers to switch to the new methods. Review URL: http://codereview.chromium.org/17243 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7811 0039d316-1c4b-4281-b951-d872f2087c98
* Convert download manager to FilePath.estade@chromium.org2009-01-061-2/+4
| | | | | | | | (Fixed up version of issue 17032. Now passes all unit tests.) Review URL: http://codereview.chromium.org/16533 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7630 0039d316-1c4b-4281-b951-d872f2087c98
* Unbreak unit tests. Revert r7564.estade@chromium.org2009-01-051-2/+0
| | | | | | | | tbr=jhawkins Review URL: http://codereview.chromium.org/16522 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7571 0039d316-1c4b-4281-b951-d872f2087c98
* * switch download manager to using FilePathestade@chromium.org2009-01-051-0/+2
| | | | | | | | | * add empty() function to FilePath * implement file_util::GetFileExtensionFromPath Review URL: http://codereview.chromium.org/17032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7564 0039d316-1c4b-4281-b951-d872f2087c98
* file_util minor cleanup:erikkay@google.com2008-12-231-0/+7
| | | | | | | | | | * add POSIX version of IsPathWritable * convert IsPathWritable to FilePath * convert CreateNewTempDirectory to FilePath * fix a bug where recursive delete errors weren't being handled in POSIX Review URL: http://codereview.chromium.org/16241 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7430 0039d316-1c4b-4281-b951-d872f2087c98
* revert r6938estade@chromium.org2008-12-121-6/+8
| | | | | | | (i.e. reapply 6935, with fix) Review URL: http://codereview.chromium.org/14087 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6953 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 6935.ojan@google.com2008-12-121-8/+6
| | | | | | | Broke compile Review URL: http://codereview.chromium.org/14083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6938 0039d316-1c4b-4281-b951-d872f2087c98
* Implement the memory mapped file class for posix.estade@chromium.org2008-12-121-6/+8
| | | | | | Review URL: http://codereview.chromium.org/14073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6935 0039d316-1c4b-4281-b951-d872f2087c98
* Add a MemoryMappedFile class to file_util.estade@chromium.org2008-12-121-1/+38
| | | | | | | | Factor out windowisms from the spell checker. Review URL: http://codereview.chromium.org/14041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6919 0039d316-1c4b-4281-b951-d872f2087c98
* Move file enumeration to filepaths.avi@google.com2008-12-111-7/+9
| | | | | | Review URL: http://codereview.chromium.org/13315 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6784 0039d316-1c4b-4281-b951-d872f2087c98
* Get rid of kPathSeparator on windows. Port some wstring function to take ↵estade@chromium.org2008-12-041-14/+8
| | | | | | | | FilePaths. Re-enable relevant posix unit tests. Review URL: http://codereview.chromium.org/12893 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6387 0039d316-1c4b-4281-b951-d872f2087c98
* Remove file_util::kPathSeparator from posix.estade@chromium.org2008-11-271-10/+25
| | | | | | Review URL: http://codereview.chromium.org/12489 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6099 0039d316-1c4b-4281-b951-d872f2087c98
* Append a trailing slash on file directory URLs. Thus a link to /directory ↵estade@chromium.org2008-11-251-3/+8
| | | | | | | | will work just as well as a link to /directory/ Review URL: http://codereview.chromium.org/12620 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5999 0039d316-1c4b-4281-b951-d872f2087c98
* Port directory lister to allow the linux and mac test shells to display file ↵estade@chromium.org2008-11-201-0/+14
| | | | | | | | | | directories. This is a revision of r5725. It doesn't break mac build. Review URL: http://codereview.chromium.org/11507 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5792 0039d316-1c4b-4281-b951-d872f2087c98
* revert 5730estade@chromium.org2008-11-191-14/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5731 0039d316-1c4b-4281-b951-d872f2087c98
* Port directory lister to posix.estade@chromium.org2008-11-191-0/+14
| | | | | | | | Fix of issue 11437. Review URL: http://codereview.chromium.org/11293 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5730 0039d316-1c4b-4281-b951-d872f2087c98
* revert 5725estade@chromium.org2008-11-191-14/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5727 0039d316-1c4b-4281-b951-d872f2087c98
* Port directory lister so test shell can view file directories.estade@chromium.org2008-11-191-0/+14
| | | | | | Review URL: http://codereview.chromium.org/11437 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5725 0039d316-1c4b-4281-b951-d872f2087c98
* Implement some missing file util functions.estade@chromium.org2008-11-171-0/+2
| | | | | | Review URL: http://codereview.chromium.org/11208 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5571 0039d316-1c4b-4281-b951-d872f2087c98
* * Revert "Por rt flush_cache tool."agl@chromium.org2008-11-111-4/+0
| | | | | | | | | This reverts commit 3bd600b37c5ee613c004c84736ee3cb69434562a. Review URL: http://codereview.chromium.org/9774 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5184 0039d316-1c4b-4281-b951-d872f2087c98
* Port flush_cache tool.agl@chromium.org2008-11-111-0/+4
| | | | | | | | | | BUG=4160 Review URL: http://codereview.chromium.org/9639 Patch from Paweł Hajdan jr. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5182 0039d316-1c4b-4281-b951-d872f2087c98
* Added CreateTemporaryFileName that takes a FilePath argument.estade@chromium.org2008-11-111-2/+3
| | | | | | Review URL: http://codereview.chromium.org/9752 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5142 0039d316-1c4b-4281-b951-d872f2087c98
* Port more of url_request_unittest.cc.dkegel@google.com2008-11-041-0/+5
| | | | | | | | Also do a little bit of the FilePath rewrite as it pertains to this test. Review URL: http://codereview.chromium.org/9074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4652 0039d316-1c4b-4281-b951-d872f2087c98
* Always show file extensions in the shelf.glen@chromium.org2008-11-031-0/+3
| | | | | | | | BUG=1208 Review URL: http://codereview.chromium.org/8991 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4450 0039d316-1c4b-4281-b951-d872f2087c98
* Begin the first small step towards using FilePath everywhere:evanm@google.com2008-10-301-0/+28
| | | | | | | | | | - Add some transition APIs. - Start migrating some code to transition APIs. Review URL: http://codereview.chromium.org/8825 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4254 0039d316-1c4b-4281-b951-d872f2087c98
* Make sure it's possible to download to a network share.nsylvain@chromium.org2008-10-271-2/+2
| | | | | | | | | | | | | | | | The function to move the file was failing to set the security descriptor. Now we use SHFileOperation, which has a flag to do everything we want. Eventually we might want to display ui on errors and use the ui features of SHFileOperation, but for the 1.0 build we want to stick to a smaller and less risky change. BUG: 984 Review URL: http://codereview.chromium.org/8128 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3996 0039d316-1c4b-4281-b951-d872f2087c98
* This CL adds prompting for dangerous types of files (executable) when they ↵jcampan@chromium.org2008-10-101-0/+4
| | | | | | | | | | | | | | | | are automatically downloaded. The file is saved with a temporary name (dangerous_download_xxxx.download) in the download directory and the user is presented (in the download shelf and the download tab if opened) with a warning message and buttons to save/discard the download. If discarded the download is removed (and its file deleted). If saved, download goes as usual. Dangerous downloads not confirmed by the user are deleted on shutdown. TEST=Download a small exe file, try using the save/discard button from the download shelf and from the download tab (the intent is that the file has been entirely downloaded by the time you take action). Try again with a slow/big download (that time the download is expected not to be finished when approved/discarded). Review URL: http://codereview.chromium.org/6043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3228 0039d316-1c4b-4281-b951-d872f2087c98
* Fix some problems with machine level install.kuchhal@chromium.org2008-10-081-0/+4
| | | | | | | | BUG=2380 Review URL: http://codereview.chromium.org/6402 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3015 0039d316-1c4b-4281-b951-d872f2087c98
* Cross-platform wrappers for fopen, _wfopen_s, etc.mark@chromium.org2008-10-011-0/+9
| | | | | | | | | Patch by Paweł Hajdan jr <phajdan.jr@gmail.com>. http://codereview.chromium.org/6005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2760 0039d316-1c4b-4281-b951-d872f2087c98
* Add file_util::GetFileInfo as a means to provide more information about a filedarin@google.com2008-09-261-0/+14
| | | | | | | | | | | path. This CL changes GetFileSize to be implemented in terms of GetFileInfo since under the hood on all platforms the same system call is used. R=mark Review URL: http://codereview.chromium.org/4286 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2624 0039d316-1c4b-4281-b951-d872f2087c98
* CreateDirectory() should check if an existing path is actually a directory ↵mmoss@google.com2008-09-111-0/+3
| | | | | | | | before skipping it. Also update a couple instances and comments to reflect current behaviour (see also http://codereview.chromium.org/1681). Review URL: http://codereview.chromium.org/1709 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2060 0039d316-1c4b-4281-b951-d872f2087c98
* Make CreateDirectory consistent on Win and Posix when directory exists.mmoss@google.com2008-09-091-2/+2
| | | | | | Review URL: http://codereview.chromium.org/1681 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1941 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup some comment typos.ericroman@google.com2008-08-181-2/+2
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@984 0039d316-1c4b-4281-b951-d872f2087c98
* one more try before reverterikkay@google.com2008-08-151-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@948 0039d316-1c4b-4281-b951-d872f2087c98
* Part two of file_util porting. Almost all of the functionality has been ↵erikkay@google.com2008-08-151-7/+31
| | | | | | ported, including the unit tests now. Some of this API isn't great, and should be cleaned up, but I'd like to hold off and do that in a followup changelist. More general code cleanup is likely needed here as well. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@944 0039d316-1c4b-4281-b951-d872f2087c98
* I accidentally committed file_version_info. Since comments were relatively ↵erikkay@google.com2008-08-121-0/+4
| | | | | | minor, I created a new CL rather than reverting the old one. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@722 0039d316-1c4b-4281-b951-d872f2087c98
* Add defines for the size of wchar_t to build_config.h. Use this in places ↵brettw@google.com2008-08-071-10/+11
| | | | | | | | | | where we currently have an OS-specific check. Remove all WIN32 ifdefs from base and replace them with proper defined(OS...). I also fixed random style bits when I encountered them. I made major style fixes to string16. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@524 0039d316-1c4b-4281-b951-d872f2087c98
* Refactoring file_util into file_util and file_util_win. Also fix windows ↵erikkay@google.com2008-08-061-0/+16
| | | | | | | | dependencies in path_service.cc. One questionable decision here was to put GetCurrentDirectory and SetCurrentDirectory into file_util_win.cc. I could have kept the logic in path_service.cc with #ifdefs or I could have split up path_service.cc into path_service_win.cc, etc. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@436 0039d316-1c4b-4281-b951-d872f2087c98
* Add base to the repository.initial.commit2008-07-261-0/+302
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8 0039d316-1c4b-4281-b951-d872f2087c98