CODE SNIPPETS

CODESNIPPETS FOR .NET, SQL, JAVASCRIPT, JQUERY and more

  1. c-plusplus

c-plusplus

How to check if a file exists in C++

 Administrator
 July 11, 2014
1 Comment

To check if a file exists in C++ you can use the following snippet.

Sample C++

#include <sys/stat.h>

inline bool fileExists (const std::string& fileName) {
	struct stat buff;   
	return (stat (fileName.c_str(), &buff) == 0); 
}

  Posted in C-PlusPlus
  Tagged c plus plus, c++, c-plusplus, check, clang, cplusplus, eval, exist, exists, file, files, filesystem, gcc, if, IO, OS, Path, System, that, vc
  Permalink

Search


Search for:

Navigation


  • Menu
    • DISCLAIMER / HAFTUNGSAUSSCHLUSS
    • IMPRINT / IMPRESSUM
    • PRIVACY POLICY / DATENSCHUTZ
    • Submit a Snippet
  • Projects
    • Fesslersoft.Extensions
    • Tornadocapture
  • Tools
    • Base64 Encoder/Decoder
    • Colorpicker
    • MD5 Hash Creator
    • UUID/GUID Generator
    • XML Formatter
Subscribe via RSS

Meta


  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Categories


  • .NET
  • Android
  • AngularJs
  • Announcements
  • Batch
  • C
  • C#
  • C-PlusPlus
  • CSS
  • Devexpress
  • HTML / HTTP / WEB
  • ios
  • Java
  • Javascript
  • jQuery
  • Microsoft SQL Server
  • Mobile
  • Most Read Articles
  • MySql
  • NuGet
  • Objective-C
  • Oracle
  • PHP
  • Powershell
  • Python
  • Regex
  • Ruby
  • SQLite
  • VB.Net
  • VB6
  • VBA
  • VBScript
  • Wordpress
  • XML
  • XSD
  • XSL

Popular Posts


The 10 most visited posts in last 30 days:
  • How to remove unicode characters from a string in C# and VB.NET
  • How to sort a collection in VBA
  • How to restart a Application in C# or VB.NET
  • How to convert Stream to ByteArray in C# and VB.NET
  • How to remove columns from DataTable in C# and VB.NET
  • How to get the Temp folder in VBA
  • How to refresh the current Android Fragment
  • How to encode and decode Base64 in C# and VB.NET
  • How to escape brackets using string.Format in C# and VB.NET
  • How to use a select in update statement using MSSQL

Recent Posts


  • How to get the current path using VBScript
  • How to disable all links using jQuery
  • How to remove class after delay in jQuery
  • How to check if a value is a double value in Android (Java)
  • How to refresh the current Android Fragment

Recent Comments


  • CodeSnippetBlog on How to get the current path using VBScript
  • AllCodeSnippets on How to get the current path using VBScript
  • Realliferulor on How to get the current path using VBScript
  • Manav6677 on How to disable all links using jQuery
  • javascriptd on How to disable all links using jQuery

Archives


  • August 2016
  • June 2016
  • December 2015
  • November 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • November 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
Back to top

Most used Tags


.net all array C# char character characters chars check convert csharp css Directory Extension file files folder get html IO is Java javascript jQuery js list net php Python query remove retrieve select SQL String Strings System to vb.net Visual Studio 2005 Visual Studio 2008 Visual Studio 2010 Visual Studio 2012 Visual Studio 2013 XML

Copyright © 2021 CODE SNIPPETS. Powered by WordPress and Alétheia.