file Questions

7

Solved

I have a class MyClass and an inner class MyNestedClass like this: public class MyClass { ... public class MyNestedClass { ... } } Both classes are very long. Because of that i'd like to sep...
Cumber asked 2/6, 2011 at 18:29

28

Solved

How can I delete the contents of a local folder in Python? The current project is for Windows, but I would like to see *nix also.
Samaveda asked 9/10, 2008 at 4:22

4

I have the below code to try search for all files in my downloads folder and then delete them all however it's returning an error message based on the kill function not having enough arguments, any...
Bondon asked 24/5, 2017 at 15:32

7

Solved

I have written the following script to concatenate all the files in the directory into one single file. Can this be optimized, in terms of idiomatic python time Here is the snippet: import...
Cottonwood asked 19/7, 2013 at 15:8

14

Solved

I have a process that's writing a lot of data to stdout, which I'm redirecting to a log file. I'd like to limit the size of the file by occasionally copying the current file to a new name and trunc...
Hearsh asked 11/6, 2009 at 9:55

4

In C#, what's the simplest/safest/shortest way to make a file appear as though it has been modified (i.e. change its last modified date) without changing the contents of the file?
Sile asked 11/11, 2009 at 16:43

72

Solved

How do I include a JavaScript file inside another JavaScript file, similar to @import in CSS?
Quip asked 4/6, 2009 at 11:59

11

Solved

In my app the user is to select an audio file which the app then handles. The problem is that in order for the app to do what I want it to do with the audio files, I need the URI to be in file form...
Kane asked 14/4, 2011 at 0:54

6

Solved

I have this code: line1 = [] line1.append("xyz ") line1.append("abc") line1.append("mno") file = open("File.txt","w") for i in range(3): file.wr...
Didier asked 4/7, 2017 at 9:13

10

Solved

I have a local markdown file containing several links and I want that links head to local file like pdf. I use the following syntax: [my link](file:///C:/my_file.pdf) But when I open my markdow...
Rohrer asked 14/9, 2015 at 10:57

6

I'd like to write a function that deletes all empty folders, with the option to ignore certain file types (allowed file types are stored in the hashmap) and tell if it should look inside directorie...
Precondition asked 24/9, 2014 at 12:57

8

Solved

Just started using Kotlin and created some activities as Kotlin Files. They work, but still, I want to know what the difference between creating a File and a Class.
Stratify asked 13/3, 2017 at 17:33

6

Solved

I've got a junk directory where I toss downloads, one-off projects, email drafts, and other various things that might be useful for a few days but don't need to be saved forever. To stop this direc...
Mononucleosis asked 5/11, 2008 at 17:13

3

Solved

As part of a larger task performed in R run under windows, I would like to copy selected files between directories. Is it possible to give within R a command like cp patha/filea*.csv pathb (notice ...
Facilitation asked 5/3, 2010 at 4:10

1

I write a program with typescript in node js (not an API or web app) just a console app. I have configured the typescript configuration. but when I make a File Object it give me error UnhandledProm...
Nietzsche asked 4/9, 2021 at 5:10

41

How do I check whether a file exists or not, without using the try statement?
Influential asked 17/9, 2008 at 12:55

6

Solved

I have a couple of M4A (sound) files on a Mac that I want to combine into a single sound file. Can this be done with a Terminal command? Is there such a thing?
Benoni asked 25/8, 2013 at 23:48

5

Solved

I'm developing a little app in Electron from which I can upload an image to Instagram and I'm stuck at one of the first steps :/ I want to select an image from the filesystem and display it in my ...
Bithia asked 10/6, 2018 at 8:6

7

Solved

Is there any way of checking if a byte[] is a pdf without opening? I have some code to display a list of byte[] as pdf thumbnails. I previously knew all the byte[] were pdf's because we filtered t...
Bhagavadgita asked 31/5, 2011 at 11:38

6

Solved

Basically I'm wondering why this doesn't output anything: tail --follow=name file.txt | grep something | grep something_else You can assume that it should produce output I have run another line...
Convection asked 25/3, 2011 at 1:9

7

I would like to get a list of files with a specific extension in a directory. In the API (Java 6), I see a method File.listFiles(FileFilter) which would do this. Since I need a specific extension,...
Dishonest asked 22/4, 2011 at 0:56

7

Solved

I am given a list of paths that I need to check files within. Of course, if I am given a root, and a subdirectory, there is no need to process the sub-directory. For example c:\test // process this...
Shornick asked 13/1, 2012 at 17:8

2

According to mmap() manpage: MAP_PRIVATE Create a private copy-on-write mapping. Updates to the mapping are not visible to other processes mapping the same file, and are not carried through t...
Bullyrag asked 7/6, 2019 at 17:42

10

I find myself doing this a lot just to ensure the filename is not in use. Is there a better way? Directory.Exists(name) || File.Exists(name)
Higgledypiggledy asked 3/4, 2010 at 10:22

17

Solved

I'm trying to write a simple Python script that will copy a index.tpl to index.html in all of the subdirectories (with a few exceptions). I'm getting bogged down by trying to get the list of subd...
Involucre asked 28/4, 2009 at 22:59

© 2022 - 2024 — McMap. All rights reserved.