• Register

Recent questions tagged file

0 votes
1 answer 1 view
Problem: Why I got the error : java io filenotfoundexception too many open files HELP! I need help understanding this error: java io filenotfoundexception too many open files Can someone please help fix this, I am new in java. Anyone have ideas on what I need to do to fix this? Thanks!
asked 20 hours ago Ali 5.4k points
0 votes
0 answers 3 views
Problem: Find file names in a folder in python
asked 23 hours ago Ashty 1.7k points
0 votes
1 answer 2 views
Problem: How to read line by line in python and store each line as an element in an list ?
asked 1 day ago Ashty 1.7k points
0 votes
1 answer 2 views
Problem: Why I got the error: pip bad interpreter: no such file or directory How to fix this error: pip bad interpreter: no such file or directory Any ideas on what I need to do to fix this? Thanks!
asked 2 days ago Mashhoodch 9.9k points
0 votes
1 answer 3 views
Problem: I want to delete a file that is already is used in another process My code looks like: string[] files = Directory.GetFiles(@"C:\SEDocumentConverter\SOURCE"); foreach (string file in files) { File.Delete(file); }
asked 5 days ago Ashty 1.7k points
0 votes
1 answer 6 views
Problem: .. ... int a = scanner.nextInt(); scanner.nextLine(); // Simply consumes the bothersome \n String s = scanner.nextLine(); I know how to read a file with Java using Scanner and File IOException, but the only thing I don't know is how to store the text in the files as an array.
asked Feb 24 Ali 5.4k points
1 vote
1 answer 10 views
Problem: I am using a scientific software including a Python script that is calling os.system() which is used to run another scientific program. While the subprocess is running, Python at some point prints the following: close failed in file object destructor: IOError: [Errno ... type of IOError? What does it exactly mean? What does it mean for the subprocess that has been invoked by os.system()?
asked Feb 23 Mashhoodch 9.9k points
0 votes
1 answer 5 views
Problem: No such file or directory error? Are you staring at an error that says: python: can't open file 'myfile.txt': [Errno 2] No such file or directory Or maybe: IOError : No such file or directory Are you saying something like: "Curses! It works on my machine?"?
asked Feb 23 Mashhoodch 9.9k points
0 votes
1 answer 2 views
Problem: I am using subprocess to call another program and save its return values to a variable. This process is repeated in a loop, and after a few thousands times the program crashed with the following error: Traceback (most recent call last): File ". ... /python3.2/subprocess.py", line 1166, in _execute_child errpipe_read, errpipe_write = _create_pipe() OSError: [Errno 24] Too many open files
asked Feb 23 Mashhoodch 9.9k points
0 votes
1 answer 5 views
Problem: In Python, I want to convert all strings in a list to integers. So if I have: results = ['1', '2', '3'] How do I make it: results = [1, 2, 3]
asked Feb 23 Mashhoodch 9.9k points
0 votes
1 answer 8 views
Problem: how to delete file if exists in c#
asked Feb 22 kaash_kashi 1.2k points
0 votes
1 answer 3 views
Problem: How to read file line by line in Java There are following ways to read a file line by line which i learn : BufferedReader Class Scanner class Example of read a file line by line using BufferedReader class
asked Feb 21 Ali 5.4k points
0 votes
1 answer 12 views
Problem: the system cannot find the file specified in python
asked Feb 21 kaash_kashi 1.2k points
0 votes
1 answer 10 views
Problem: I searched around but i couldn't find any post to help me fix this problem, I found similar but i couldn't find any thing addressing this alone anyway. Here's the the problem I have, I'm trying to have a python script search a text file, the text file has numbers in a ... output is every thing containing a 2 and a 0, so i get 220 foo 200 bar etc. How can i fix this so it just find "20"
asked Feb 20 Mashhoodch 9.9k points
0 votes
1 answer 8 views
Problem: I have a file named "word.txt". It is in the same directory as my java file. But when I try to access it in the following code this file not found error occurs: Exception in thread "main" java.io.FileNotFoundException: word.txt (The system ... Native Method) at java.io.FileInputStream.<init>(Unknown Source) at java.util.Scanner.<init>(Unknown Source) at Hangman1.main(Hangman1.java:6)
asked Feb 20 Ali 5.4k points
0 votes
1 answer 12 views
Problem: How do I read every line of a file in Python and store each line as an element in a list? I want to read the file line by line and append each line to the end of the list. Don't use file.readlines() in a for-loop, a file object itself is enough: lines = [line.rstrip('\n') for line in file]
asked Feb 19 Mashhoodch 9.9k points
0 votes
1 answer 10 views
Problem: I get an error when I try to open a file in Python. Here is my code : >>> import os.path >>> os.path.isfile('/path/to/file/t1.txt') >>> True >>> myfile = open('/path/to/file/t1.txt','w') >>> myfile >>> <open file '/path/to/file/ ... <module> IOError: File not open for reading I also tried: for line in myfile: print(line) and I got the same error. Does anybody know why this error occurs?
asked Feb 19 Mashhoodch 9.9k points
0 votes
1 answer 8 views
Problem: I have the following source code public class mod_MyMod extends BaseMod public String Version() { return "1.2_02"; } public void AddRecipes(CraftingManager recipes) { recipes.addRecipe(new ItemStack(Item.diamond), new Object[] { "#", Character.valueOf('#'), Block. ... it I get the following error: java:11: reached end of file while parsing } What am I doing wrong? Any help appreciated.
asked Feb 18 Ali 5.4k points
0 votes
1 answer 8 views
Problem: Is this the cleanest way to write a list to a file, since writelines() doesn't insert newline characters? file.writelines(["%s\n" % item for item in list]) It seems like there would be a standard way...
asked Feb 17 Mashhoodch 9.9k points
0 votes
1 answer 12 views
Problem: How to read each line of a python file and store each line as an element of an array? I want to read the file line by line and each line is appended to the end of the array. I couldn't find how to do everything and I couldn't find how to create an array of strings in Python.
asked Feb 15 sasha 13.2k points