summaryrefslogtreecommitdiff
path: root/src/File.cc
Commit message (Collapse)AuthorAgeFilesLines
* Enable IndentPPDirectivesTatsuhiro Tsujikawa2018-06-091-1/+1
|
* clang-formatTatsuhiro Tsujikawa2018-05-151-1/+1
|
* mingw: Use SetFileTime to avoid DST adjustmentTatsuhiro Tsujikawa2017-11-291-4/+42
|
* clang-formatTatsuhiro Tsujikawa2017-01-161-1/+1
|
* Better error message when local file status cannot be retrievedTatsuhiro Tsujikawa2017-01-151-0/+10
|
* Use default where possibleNils Maier2016-08-291-2/+2
|
* make clang-format using clang-format-3.6Tatsuhiro Tsujikawa2015-12-271-68/+84
|
* mingw: fix handle leak in File::sizeNils Maier2015-12-011-4/+2
|
* mingw: Use GetFileSize to get file sizeTatsuhiro Tsujikawa2015-11-231-1/+35
| | | | | | | | _wstat family does not work with symbolic links. They always returns size 0. To workaround this, we now use GetFileSize to get file size. To do that, we need to first obtain file HANDLE, which is a bit tedious because of the messy interface of CreateFileW, but we have no way to get around it.
* Rewrite Time with chronoTatsuhiro Tsujikawa2015-06-091-4/+4
|
* mingw: Use MoveFileExW for better atomic moveTatsuhiro Tsujikawa2014-10-101-7/+12
|
* Clean up if defined styleTatsuhiro Tsujikawa2013-09-171-1/+1
|
* Rewritten File::getPathSeparators()Tatsuhiro Tsujikawa2012-09-241-4/+3
|
* Removed A2STR strings other than NILTatsuhiro Tsujikawa2012-09-241-4/+4
|
* Use int64_t instead of off_tTatsuhiro Tsujikawa2012-06-251-1/+1
| | | | | Some classes such as DiskAdaptor, DiskWriter, FileAllocationIterator and ChecksumValidator are left unchanged.
* Supported Windows UNC path.Tatsuhiro Tsujikawa2012-02-191-1/+31
|
* Replaced uint64_t with off_t or int64_t.Tatsuhiro Tsujikawa2011-12-091-1/+1
| | | | | Since off_t is int64_t with LFS, we cannot take advantage of extra capacity of uint64_t.
* Code cleanup. Avoid std::string temporaries.Tatsuhiro Tsujikawa2011-11-051-1/+1
|
* Use utimes instead of utime if utimes is available.Tatsuhiro Tsujikawa2011-08-191-1/+11
|
* MinGW32 build: Replace all '\' in path with '/' in util::applyDir()Tatsuhiro Tsujikawa2011-08-181-2/+14
| | | | | | In MinGW32 build, replace all '\' in path with '/' in util::applyDir(). Take into account '\' in File::getBasename() and File::getDirname().
* Added global::cerr. windows.h now included from common.hTatsuhiro Tsujikawa2011-08-101-5/+0
| | | | | | | We replaced most of std::cerr with global::cerr. windows.h is now included from common.h. Before including it, we define WINVER. We renamed some variable name because some macros in windows.h collide with them.
* Removed utf8ToNative from log message and exception message.Tatsuhiro Tsujikawa2011-08-081-4/+3
|
* In MinGW32, open file with UNICODE filename and print them in ANSI.Tatsuhiro Tsujikawa2011-08-041-12/+23
|
* Fixed the bug that making directory fails on Windows OS.Tatsuhiro Tsujikawa2011-01-091-7/+31
| | | | | | On Windows, stat("C:/test/", ...) fails because of trailing "/". To handle "\" as path separator, "\" are replaced with "/" beforehand.
* 2010-11-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-261-2/+2
| | | | | | | Include last '/' to directory name to create. This will avoid to create directory 'C:' in Windows. * src/File.cc
* 2010-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-141-1/+11
| | | | | | | | | Added .cc file for classes/structs that only provided by header file. Defined non-POD classes' ctor, dtor in .cc file. Moved implementation code in header file to .cc file for major classes/strucsts.
* 2010-10-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-10-111-15/+14
| | | | | | | Rewritten File::mkdirs() * src/File.cc
* 2010-06-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-211-15/+15
| | | | | | | Changed naming standards for class member variable: now it looks like var_ instead of _var.
* 2010-06-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-121-15/+15
| | | | | | | | Renamed member variables. * src/File.cc * src/File.h
* 2010-03-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-02-281-2/+2
| | | | | | | | Avoid to calculate end() iterator in each loop. std::deque is particularly slow. Make sure that recalculate end iterator if element is erased during loop.
* 2010-01-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-01-241-1/+1
| | | | | | | | | | | | | | | Fixed compile error with i586-mingw32msvc-g++. Always Cut console readout by 80 characters in mingw32 build. Catch exception in DHTMessageReceiver::receiveMessage(). * src/AbstractDiskWriter.cc * src/ConsoleStatCalc.cc * src/DHTMessageReceiver.cc * src/File.cc * src/RequestGroupMan.cc * src/a2io.h * test/FileTest.cc
* 2010-01-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-01-051-1/+1
| | | | | | | | | Untabify. Fixed one line in copyright which is longer than 80 columns. * src * test
* 2009-10-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-10-221-1/+1
| | | | | | | | | | Renamed Util.{cc,h} as util.{cc,h} * src/Util.cc * src/Util.h * src/util.cc * src/util.h
* 2009-10-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-10-221-2/+2
| | | | | | | | Moved static functions in Util class to namespace util. * src * test
* 2009-10-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-10-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | Replaced Util::slice() with split() * src/AbstractCommand.cc * src/CookieParser.cc * src/File.cc * src/HttpHeaderProcessor.cc * src/HttpRequest.cc * src/Metalink2RequestGroup.cc * src/MetalinkParserController.cc * src/Netrc.cc * src/NsCookieParser.cc * src/ParameterizedStringParser.cc * src/ServerStatMan.cc * src/UriListParser.cc * src/Util.cc * src/Util.h * src/bittorrent_helper.cc * test/UtilTest.cc
* 2009-09-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-09-191-11/+6
| | | | | | | Simplified File::getCurrentDir() * src/File.cc
* 2009-06-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-06-201-0/+18
| | | | | | | | | | | | | | The default value of --dir option is the absolute path to the current directory. If getcwd() is failed, then it is ".", which is the same value with old implementation. This change is necessary because after daemon() call, the current working directory is changed to /. * src/File.cc * src/File.h * src/OptionHandlerFactory.cc * src/option_processing.cc
* 2009-06-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid intermediate object during string concatenation. Replaced post-increment unary operator with pre-increment one in for loop. * src/AdaptiveURISelector.cc * src/AnnounceList.cc * src/AuthConfig.h * src/BtBitfieldMessage.cc * src/BtExtendedMessage.cc * src/BtHandshakeMessage.cc * src/BtPieceMessage.cc * src/BtPortMessage.cc * src/Cookie.cc * src/DHTAnnouncePeerMessage.cc * src/DHTAutoSaveCommand.cc * src/DHTGetPeersReplyMessage.cc * src/DHTNode.cc * src/DHTQueryMessage.cc * src/DHTResponseMessage.cc * src/DHTUnknownMessage.cc * src/DefaultBtAnnounce.cc * src/DefaultBtContext.cc * src/DefaultBtInteractive.cc * src/DefaultBtProgressInfoFile.cc * src/DefaultPeerStorage.cc * src/DownloadEngine.cc * src/FeatureConfig.cc * src/File.cc * src/FtpConnection.cc * src/FtpNegotiationCommand.cc * src/HandshakeExtensionMessage.cc * src/HttpConnection.cc * src/HttpRequest.cc * src/HttpResponseCommand.cc * src/HttpServer.cc * src/IndexBtMessage.cc * src/Metalink2RequestGroup.cc * src/OptionHandlerImpl.h * src/PStringBuildVisitor.cc * src/Peer.cc * src/PeerListenCommand.cc * src/Piece.cc * src/RangeBtMessage.cc * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroupMan.cc * src/ServerStat.cc * src/ServerStatMan.cc * src/UTPexExtensionMessage.cc * src/Util.cc * src/a2functional.h * src/download_helper.cc * src/messageDigest.cc
* 2008-10-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-10-071-0/+1
| | | | | | | | | | Fixed compile error with gcc-4.4(snapshot) * src/File.cc * src/FtpConnection.cc * src/OptionHandlerImpl.h * src/Util.cc
* 2008-09-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-09-301-4/+7
| | | | | | | | | | | | | | Fixed compile error with debian mingw32 cross compiler(4.2.1). The configuration is minimum: no torrent, no metalink, so there may be other compile error on their code. * src/a2netcompat.h * src/File.cc * src/File.h * src/SocketCore.cc * src/SocketCore.h
* 2008-09-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-09-071-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented the ability to get timestamp from remote HTTP server and apply it to local file. To enable this feature, --remote-time option is added. No usage text has been written yet. If several servers returns difference timestamp, then aria2 uses latest one. * src/CopyDiskAdaptor.cc * src/CopyDiskAdaptor.h * src/DirectDiskAdaptor.cc * src/DirectDiskAdaptor.h * src/DiskAdaptor.h * src/File.cc * src/File.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpResponse.cc * src/HttpResponse.h * src/HttpResponseCommand.cc * src/HttpResponseCommand.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/OptionHandlerFactory.cc * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/option_processing.cc * src/prefs.cc * src/prefs.h * test/CopyDiskAdaptorTest.cc * test/FileTest.cc * test/Makefile.am * test/Makefile.in * test/MultiDiskAdaptorTest.cc * test/TestUtil.cc
* 2008-07-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-07-061-6/+6
| | | | | | | | | | | | | | | Introduced a2_struct_stat. It is defined as `struct _stati64' if __MINGW32__ is defined, because under MinGW32, _stati64 is used and its second argument is of type `struct _stati64'. Otherwise it is defined as `struct stat'. * src/AbstractDiskWriter.cc * src/File.cc * src/File.h * src/a2io.h
* 2008-05-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-141-7/+7
| | | | | | | | | | Use A2STR::SLASH_C, A2STR::DOT_C instead of "/", "." respectively. * src/A2STR.cc * src/A2STR.h * src/File.cc
* 2008-05-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-131-2/+3
| | | | | | | | | | | Replaced "" with static const variable A2STR::NIL. Replaced string comparison against "" with std::string::empty(). Added PROTO_* to Request class and use them as a protocol string constant. Made "started", "stopped", "completed" static const variable in AnnounceList class.
* 2008-03-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-03-161-12/+18
| | | | | | | | | | Rewritten getBasename() and getDirname(), without standard library basename(), dirname(). * src/File.cc * test/FileTest.cc
* 2008-03-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-03-151-0/+2
| | | | | | | Fixed compilation error with g++-4.3
* 2008-03-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-03-091-2/+2
| | | | | | type cleanup for allmost all remaining files.
* 2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-02-081-11/+18
| | | | | | | | | Removed "using namespace std;" from all sources. Appended std:: prefix to c++ standard classes. Included string.h where mem* function are used.
* 2007-10-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-10-111-0/+23
| | | | | | | | | | Implemented BitTorrent/http/ftp integrated download. I've rewritten lots of files and now some headers have forward class declarations to reduce compile time. The implementation is extremely alpha stage, I recommend to use this for testing purpose only.
* 2007-07-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-07-231-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merged Ross's win32 patch(manually) In the course of merging, following files are added. * src/strptime.{h,c} * src/libgen.{h,c} * src/inet_aton.{h,c} * src/Platform.{h,cc} * src/localtime_r.{h,c} * src/getaddrinfo.{h,c} I've gethered network related things, and put them to following file: * src/a2netcompat.h Also io related things are put to following file: * src/a2io.h Changed %lld to %s because mingw32 doesn't recognize %lld. * src/message.h (MSG_ALLOCATION_COMPLETED) (EX_TOO_LARGE_FILE) (EX_SIZE_MISMATCH) (EX_FILE_OFFSET_OUT_OF_RANGE) (EX_INVALID_CHUNK_CHECKSUM) (EX_INVALID_RANGE_HEADER) * src/FileAllocationCommand.cc * src/HttpResponse.cc * src/RequestGroup.cc * src/MultiDiskAdaptor.cc * src/OptionHandlerImpl.h * src/HttpResponseCommand.cc * src/FtpNegotiateCommand.cc * src/IteratableChecksumValidator.cc * src/SegmentMan.cc * src/ChunkChecksumValidator.cc Added Randomizer::getRandomNumber(long int) * src/Randomizer.h (getRandomNumber) * src/SimpleRandomizer.h (getRandomNumber) * src/BitfieldMan.cc (getMissingIndexRandomly): Use this new function. * src/Util.cc (randomAlpha): Use this new function.