9 Answered Questions for the topic file io


Creating file with QB64?

With the following DIM a AS INTEGER a = 10 OPEN "myFile" FOR BINARY AS #1 PUT #1, 1, a CLOSE #1 I get a file (myFile) with two bytes (using QB64). The first byte is indeed `0A`, but... more


CreateTextFile Method is basic fails to create file at specified path?

I am using BASIC for the first time to automate a LeCroy Oscilloscope. Following examples provided by them I am attempting to create a program which uses the oscilloscope features and prints... more
File Io Ruby


How to write to file in Ruby?

I need to read the data out of database and then save it in a text file.How can I do that in Ruby? Is there any file management system in Ruby?
File Io Python


Correct way to write line to file?

I'm used to doing `print >>f, "hi there"`However, it seems that `print >>` is getting deprecated. What is the recommended way to do the line above?Update:Regarding all those answers... more
File Io Linux Io Bash


How to redirect output to a file and stdout?

In bash, calling `foo` would display any output from that command on the stdout. Calling `foo > output` would redirect any output from that command to the file specified (in this case... more
File Io C Linux Unix


C fopen vs open?

Is there any reason (other than syntactic ones) that you'd want to use FILE *fdopen(int fd, const char *mode);or FILE *fopen(const char *path, const char *mode);instead of int open(const... more


open() in Python does not create a file if it doesn't exist?

What is the best way to open a file as read/write if it exists, or if it does not, then create it and open it as read/write? From what I read, `file = open('myfile.dat', 'rw')` should do this,... more


How to delete a file or folder in Python?

File Io Python


Find all files in a directory with extension .txt in Python?

How can I find all the files in a directory having the extension `.txt` in python?

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.


Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.