search for: ofstream

Displaying 20 results from an estimated 29 matches for "ofstream".

Did you mean: fstream
2007 Feb 04
2
Problem using ofstream in C++ class in package for MacOS X
...how to create R packages using C++ classes. For this purpose I have written a small package MyClass (which I try to attach since I do not have access to a website). MyClass has methods WriteFileC() and WriteFileCpp() which implement C-style and C++-style writing of a table to a file using FILE or ofstream respectively, and the corresponding R-functions writeFileC.R and writeFileCpp.R. While I can compile and execute my package w/o problems on Fedora Core 4, I can only execute writeFileC.R on my Intel-MacBook Pro, but not writeFileCpp.R. Executing my functions I get the following output: > lib...
2009 Aug 20
6
[LLVMdev] Get LLVM assembler for a function.
We can get the llvm assembler for a Module with something as simple as std::ofstream f("code.llvm"); f << *M; Is there a method for obtaining the llvm assembler of a given Function? -- Óscar
2009 Aug 25
4
[LLVMdev] std::cout << *MyModule does not work anymore
It seems that support for dumping text representation of LLVM objects to standard channels and C++ output streams was removed. My guess is that now we must use errs() instead of std::cerr, llvm::raw_fd_ostream instead of std::ofstream, etc. The changes are not trivial, as for instance llvm::raw_fd_ostream without flags fails if the file exists, but std::ofstream does not. The changes include using new names for flags that already exist on the standard namespace (F_Force instead of O_TRUNC, etc). Is all this an unintended chang...
2016 Feb 11
3
Buildling with/without AddressSanitizer causes divergent execution behaviour
...;d like a way to catch this in gdb but I'm not sure how to do it. I took a look. MSan is complaining about this code ``` std::ostream * g_z3_log = 0; ... Z3_bool Z3_API Z3_open_log(Z3_string filename) { if (g_z3_log != 0) Z3_close_log(); g_z3_log = alloc(std::ofstream, filename); g_z3_log_enabled = true; if (g_z3_log->bad() || g_z3_log->fail()) { dealloc(g_z3_log); g_z3_log = 0; return Z3_FALSE; } return Z3_TRUE; } ``` It seems to be complaining that ``g_z3_log`` is uninitialised when...
2006 May 09
1
xapian-compact fails to rename iamflint.tmp for win32/cygwin builds
Hello, Any call to xapian-compact compiled for Win32/Cygwin ultimately fails when it tries to rename/replace iamflint.tmp with the final version. The reason is you cannot rename an opened file with Win32/Cygwin libc. To correct this, just close the output ofstream (xapian-compact.cc(534)) like: """ ofstream output(dest.c_str()); if (!output.write(buf, input.gcount())) { cerr << argv[0] << ": error writing '" << dest << "': " << strerror(errno) << endl; exit(1); } output.close...
2010 Jun 04
5
[LLVMdev] Inserting a function call into bitcode
...CallInst::Create(PrintFn, args.begin(), args.end(), "", bi); callInst->setCallingConv(CallingConv::Fast); } } } // Writing modified module to new file. std::ostream *os = new std::ofstream("newfile.bc"); WriteBitcodeToFile(&M, *os); return true; } -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100604/4152c602/attachment.html>
2010 Jun 04
0
[LLVMdev] Inserting a function call into bitcode
..."", bi); > > > >                         callInst->setCallingConv(CallingConv::Fast); > >                     } > >             } > >         } > > > >        // Writing modified module to new file. > >         std::ostream *os = new std::ofstream("newfile.bc"); > >         WriteBitcodeToFile(&M, *os); Try putting "delete os" here? -Eli >         return true; > >     } > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu         http:...
2014 Apr 13
2
Adding an external library to Xapian
...ery) { + cout << "In Database::log" << endl; + // For now usind DB's UUID to record logs + string logname = "../logs/" + this->get_uuid(); + cout << "Log file: " << logname << "Query " << query << endl; + std::ofstream logfile(logname.c_str(), ios::out | ios::app); + logfile << query << endl; + logfile.close(); +} + void Database::reopen() { diff -ur xapian-core-1.2.17-o/api/omenquire.cc xapian-core-1.2.17/api/omenquire.cc --- xapian-core-1.2.17-o/api/omenquire.cc 2014-01-29 08:28:01.000000000 +...
2016 Feb 09
3
Buildling with/without AddressSanitizer causes divergent execution behaviour
Hi, # TL;DR I've been building an application with and without the address sanitizer (with gcc 5.3 and clang 3.7.1) and I've observed that the application's behaviour changes (assertion hit/ not hit). I'm wondering if this could be a bug in address sanitizer or if the application I'm running is just buggy (e.g. doing bad things like relying on memory layout, etc.). I'm
2009 Aug 25
0
[LLVMdev] std::cout << *MyModule does not work anymore
...:40 PM, Óscar Fuentes<ofv at wanadoo.es> wrote: > It seems that support for dumping text representation of LLVM objects to > standard channels and C++ output streams was removed. My guess is that > now we must use errs() instead of std::cerr, llvm::raw_fd_ostream > instead of std::ofstream, etc. Correct. std::ostream has been purged from LLVM; the only exception is the raw_os_ostream class, which can be used to adapt an std::ostream for use with raw_ostream. This should be enough for clients which want to keep using std::ostream. > The changes are not trivial, as for instance ll...
2014 Apr 13
2
Adding an external library to Xapian
My code is not on Github. I am using the tarball as of now. The following it the error that occurred: http://pastebin.com/cVJrjUZX On Sun, Apr 13, 2014 at 8:16 PM, James Aylett <james-xapian at tartarus.org>wrote: > On 13 Apr 2014, at 15:37, Pallavi Gudipati <pallavigudipati at gmail.com> > wrote: > > > A linker error is encountered even after following the above
2007 Jan 22
2
[LLVMdev] addPassesToEmit(Whole)File changes?
...(Module*)module; const TargetMachineRegistry::Entry* entry= TargetMachineRegistry::getClosestStaticTargetForModule( *M, err1 ); TargetMachine &target=*entry->CtorFn( *M, "" ); [self generateMethodLists]; std::ostream *outStream = 0; PassManager passes; outStream = new std::ofstream( [filename fileSystemRepresentation] ); TargetData *data =new TargetData( *target.getTargetData()); passes.add(data); target.addPassesToEmitFile(passes, *outStream, FileType, false); passes.run(*M); delete outStream; }
2012 Sep 03
1
[LLVMdev] Selection DAG output as bare DAG, code review
...//FIRST OF ALL, LET US TRY NUMBERING THE NODES int in=0; for (SelectionDAG::allnodes_iterator I = CurDAG->allnodes_begin(),E = CurDAG->allnodes_end(); I != E; ++I) { I->setNodeId(in++); } //END NUMBERING THE NODES. //LET'S TRY WRITING A FILE std::ofstream myfile; std::string filename="DDGBLOCK"+convertInt(numberOfBlocks)+".txt"; myfile.open (filename.c_str()); myfile << "{\n"; for (SelectionDAG::allnodes_iterator I = CurDAG->allnodes_begin(),E = CurDAG->allnodes_end(); I != E; ++I) {...
2016 Feb 12
3
[cfe-dev] Buildling with/without AddressSanitizer causes divergent execution behaviour
...Z3 devs and leave it for now. >> >> > Did you try msan? >> >> I just have and it immediately reported a problem. I took a closer >> look and it looks like a false positive to me. > > ... > > This is because your STL was not compiled with MSan. The std::ofstream > constructor is provided by libstdc++, the writes are not instrumented, and > MSan never sees the initialization. Unfortunately, MSan is not very useful > unless you recompile your *entire* application minus glibc with msan. =/ > > It is possible to build an MSan-ified libc++ and us...
2007 Mar 05
1
[LLVMdev] building llvm head on ubuntu with glibc-2.3.6
...ibstdc++.so.6(_Znaj+0x1d)[0x400f25ed] /usr/lib/libstdc++.so.6(_ZNSt13basic_filebufIcSt11char_traitsIcEE27_M_allocate_internal_bufferEv+0x3c)[0x4009558c] /usr/lib/libstdc++.so.6(_ZNSt13basic_filebufIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode+0x72)[0x40099772] /usr/lib/libstdc++.so.6(_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode+0xb8)[0x4009a5c8] /home/ubuntu/llvm/obj/Debug/bin/tblgen(main+0xc6)[0x818b860] /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xdc)[0x401668cc] /home/ubuntu/llvm/obj/Debug/bin/tblgen(__gxx_personality_v0+0xc5)[0x80eaca1] ======= Memory map: ======== 08048...
2009 Aug 20
0
[LLVMdev] Get LLVM assembler for a function.
On Wed, Aug 19, 2009 at 10:30 PM, Óscar Fuentes<ofv at wanadoo.es> wrote: > We can get the llvm assembler for a Module with something as simple as > >      std::ofstream f("code.llvm"); >      f << *M; > > Is there a method for obtaining the llvm assembler of a given Function? I think something like "F->print(f);" will do the right thing. -Eli
2009 Aug 21
0
[LLVMdev] Get LLVM assembler for a function.
On Aug 19, 2009, at 10:30 PM, Óscar Fuentes wrote: > We can get the llvm assembler for a Module with something as simple as > > std::ofstream f("code.llvm"); > f << *M; > > Is there a method for obtaining the llvm assembler of a given > Function? In addition to the other answers, f << *F works too. Dan
2009 Aug 25
0
[LLVMdev] std::cout << *MyModule does not work anymore
Óscar Fuentes wrote: > The changes are not trivial, as for instance llvm::raw_fd_ostream > without flags fails if the file exists, but std::ofstream does not. The > changes include using new names for flags that already exist on the > standard namespace (F_Force instead of O_TRUNC, etc). Also, each of LLVM <=2.5, 2.6 and 2.7(svn) provide their own, incompatible llvm::raw_fd_ostream constructors. This makes it unneccessarily hard to su...
2011 May 30
0
2D random walk with traps convert C++ code to R code
...NTAB 32#define NDIV (1+(IM-1)/NTAB)#define EPS 1.2*pow(10,-7)#define RNMX (1.0-EPS) using namespace std;float rand1(long *idum); int main(){ long run=10000,adr=-run,x,y,hapa=0,i=0; int dimx=700,dimy=700,nrg=50, M[dimx][dimy]; double rnd,sum=0; long k[run+1],frekuenca; bool njehsuar[run+1], next; ofstream Txt("EndjeMePengesa2D.txt"); printf("\nProgrami ekzekutohet:\ni=1 ne %d",run); for (i=1;i<=run;i++){ njehsuar[i]=true; k[i]=0; } while (i<nrg){ x=dimx*rand(&adr);y=dimy*rand(&adr); if (M[x][y]!=1){ M[x][y]=1;i++ } }for (i=1;i<=run;i++){x=dimx*rand1(&adr);...
2007 Jan 22
0
[LLVMdev] addPassesToEmit(Whole)File changes?
...(Module*)module; const TargetMachineRegistry::Entry* entry= TargetMachineRegistry::getClosestStaticTargetForModule( *M, err1 ); TargetMachine &target=*entry->CtorFn( *M, "" ); [self generateMethodLists]; std::ostream *outStream = 0; PassManager passes; outStream = new std::ofstream( [filename fileSystemRepresentation] ); TargetData *data =new TargetData( *target.getTargetData()); passes.add(data); target.addPassesToEmitFile(passes, *outStream, FileType, false); passes.run(*M); delete outStream; }