read-write

R5RS Scheme input-output: How to write/append text to an output file?

只谈情不闲聊 提交于 2019-12-20 02:56:14
问题 What is a simple way to output text to file in a R5RS compliant version of Scheme? I use MIT's MEEP (which uses Scheme for scripting) and I want to output text to file. I have found the following other answers on Stackoverflow: File I/O operations - Scheme How to append to a file using Scheme Append string to existing textfile [sic] in IronScheme But, they weren't exactly what I was looking for. 回答1: The answers by Charlie Martin, Ben Rudgers, and Vijay Mathew were very helpful, but I would

How to read millions of rows from the text file and insert into table quickly

夙愿已清 提交于 2019-12-20 00:50:12
问题 I have gone through the Insert 2 million rows into SQL Server quickly link and found that I can do this by using Bulk insert. So I am trying to create the datatable (code as below), but as this is a huge file (more than 300K row) I am getting an OutOfMemoryEexception in my code: string line; DataTable data = new DataTable(); string[] columns = null; bool isInserted = false; using (TextReader tr = new StreamReader(_fileName, Encoding.Default)) { if (columns == null) { line = tr.ReadLine();

Read and Write access for FinderSync extension in a sandboxed environment

半城伤御伤魂 提交于 2019-12-19 02:06:08
问题 The scenario The user right-clicks a directory in Finder and finds a custom MenuItem. Clicking that Item will tell my app to open up a window where the user can do his work. When he is finished files need to be written to to the folder he selected by right-clicking. The Problem I got everything to work now, but the very last part. The extension can't write to the selected folder. The user selecting the folder he wants to interact with seems to not be part of the Powerbox which - how I

Flushing fopen()'ed files opened in update mode,between read and write operations.Explicit flushing needed?

天涯浪子 提交于 2019-12-18 08:55:00
问题 I have read this about the switch between read and write operations(and vice-versa) for files opened for update using fopen() (LINK) "For files open for update (those which include a "+" sign), on which both input and output operations are allowed, the stream should be flushed (fflush) or repositioned (fseek, fsetpos, rewind) between either a writing operation followed by a reading operation or a reading operation which did not reach the end-of-file followed by a writing operation." There are

How to read/write file with iOS, in simulator as well as on device?

两盒软妹~` 提交于 2019-12-18 03:37:18
问题 As I need to read a file when my app is launched and write it sometimes while using it, I tried to reach it with : NSString *dataFile = [[NSBundle mainBundle] pathForResource:@"data" ofType:@"txt"]; NSLog(@"%@",dataFile); And the file, that should be in my project folder, is instead in the simulator folder : 2012-06-13 17:36:56.398 MyFileApp[610:15203] /Users/Rob/Library/Application Support/iPhone Simulator/5.1/Applications/1FFD4436-DCCA-4280-9E47-F6474BEE0183/MyFileApp.app/myFile.txt So if I

.NET Excel Library that can read/write .xls files [closed]

筅森魡賤 提交于 2019-12-17 17:29:07
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I'm looking for an Excel library which reads/writes .xls (not .xlsx) files. I'm using excellibrary but it's very buggy and I can't

Reading/Writing MS Word files in Python

拈花ヽ惹草 提交于 2019-12-17 03:38:31
问题 Is it possible to read and write Word (2003 and 2007) files in Python without using a COM object? I know that I can: f = open('c:\file.doc', "w") f.write(text) f.close() but Word will read it as an HTML file not a native .doc file. 回答1: I'd look into IronPython which intrinsically has access to windows/office APIs because it runs on .NET runtime. 回答2: See python-docx, its official documentation is available here. This has worked very well for me. 回答3: If you only what to read, it is simplest

Reading/Writing MS Word files in Python

限于喜欢 提交于 2019-12-17 03:38:02
问题 Is it possible to read and write Word (2003 and 2007) files in Python without using a COM object? I know that I can: f = open('c:\file.doc', "w") f.write(text) f.close() but Word will read it as an HTML file not a native .doc file. 回答1: I'd look into IronPython which intrinsically has access to windows/office APIs because it runs on .NET runtime. 回答2: See python-docx, its official documentation is available here. This has worked very well for me. 回答3: If you only what to read, it is simplest

How do I read/write (program) the MBR/VBR of a flash drive?

时间秒杀一切 提交于 2019-12-13 08:06:17
问题 I'm looking for a method of reading/writing (actually programming) the Master Boot Record (or maybe VBR) of a usb mass storage device. Actually its a flash drive whose MBR I want to program, so that whenever I plug it into any computer, a program (stored on my flash drive in a file) gets executed. I know quite a bit of assembly but I don't know how to go about programming MBRs.. Please help Thanks 回答1: If you're using linux, you can simple open the device file /dev/sdXY and write to it, the

Swift - Unable to read/write from file

淺唱寂寞╮ 提交于 2019-12-13 02:40:01
问题 I'm actually not sure whether I'm not able to read or unable to write. I'm pretty sure writing works. I'm using Swift . Here are my project files. I'm trying to write an array of arrays to a file, and then read that array of arrays when the app launches. Here's my code for writing and reading, respectively. listOfTasks is my array of arrays variable. Writing: let cocoaArray : NSArray = listOfTasks cocoaArray.writeToFile(String(fileURL), atomically: true) Reading: listOfTasks = NSArray