Questions tagged [file]

A block of arbitrary information, or resource for storing information, accessible by the string-based name or path. Files are available to computer programs and are usually based on some kind of persistent storage.

A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished. Computer files can be considered as the modern counterpart of paper documents which traditionally are kept in offices' and libraries' files, and this is the source of the term.

In modern computer architectures, files are organized in a tree structure. On the top, you have a root like C:\ in systems. There are several subfolders (inner nodes) below the root, e.g. Program Files or Users. The computer files, which contain the data, are the leaves of that tree.

On based systems, many types of system information are also represented as files, in filesystems such as sysfs and devfs, even though they don't represent information on a durable storage medium.


References


Related

, , , , ,

81192 questions
20
votes
6 answers

java IO to copy one File to another

I have two Java.io.File objects file1 and file2. I want to copy the contents from file1 to file2. Is there an standard way to do this without me having to create a method that reads file1 and write to file2
Aly
  • 15,865
  • 47
  • 119
  • 191
20
votes
2 answers

How to add a file into an already existing dataTransfer object using Javascript

Assumption: A local HTML/Javascript webpage that has access to file:// At the start of a drag on a draggable HTML element, in the event handler function dragStart(e), how do I add a File object so that it is recognized as a file and ends up in the…
20
votes
2 answers

Limiting video record length for input type file on mobile devices

I'm using the file recording capability for a mobile web app I'm building: I'm wondering if there is a way to somehow limit the length of the…
mheavers
  • 29,530
  • 58
  • 194
  • 315
20
votes
2 answers

Recursive stream

I want to list all the files on my computer recursively using Java 8. Java 8 provides a listFiles method that returns all the files and directories but without recursion. How can I use it to get a full recursive list of files (without using a…
assylias
  • 321,522
  • 82
  • 660
  • 783
20
votes
6 answers

How do I distinguish a file from a directory in Perl?

I'm trying to traverse through all the subdirectories of the current directory in Perl, and get data from those files. I'm using grep to get a list of all files and folders in the given directory, but I don't know which of the values returned is a…
Zain Rizvi
  • 23,586
  • 22
  • 91
  • 133
20
votes
2 answers

Copy file if it doesn't already exist

I'm fairly new to python, and I'm wondering how I can copy and paste a file from one location to another with first checking to see if the copied file exists in the destination folder? The reason I want to check if the file exists is this script…
mpboyle
  • 261
  • 1
  • 2
  • 6
20
votes
3 answers

sails logging to file

Can someone provide an example of how to configure sails.js to log to a file? It seems like it should be straightforward, but I'm having trouble finding examples online. I'm looking at changes in the config/log.js or the config/sockets.js files.
rcheuk
  • 1,140
  • 1
  • 12
  • 32
20
votes
5 answers

How can Apache Camel be used to monitor file changes?

I would like to monitor all of the files in a given directory for changes, ie an updated timestamp. This use case seems natural for Camel using the file component, but I can't seem to find a way to configure this behavior. A uri…
Janx
  • 3,285
  • 3
  • 19
  • 24
20
votes
3 answers

Write and read php object in a text file?

I want to write a php object in a text file. The php object is like that $obj = new stdClass(); $obj->name = "My Name"; $obj->birthdate = "YYYY-MM-DD"; $obj->position = "My position"; I want to write this $obj in a text file. The text file is…
Nantu
  • 557
  • 1
  • 4
  • 16
20
votes
2 answers

Creating app which opens a custom file extension

Want to create an android application, which opens a custom-build file extension (for example, I want to open .abcd files) It is something like Adobe Reader that opens .pdf files, or Photo Viewer that opens .jpg files Specific conditions: 1. The…
topher
  • 1,357
  • 4
  • 17
  • 36
20
votes
6 answers

Is it possible to recursively require all files in a directory in Ruby?

I am working on an API that needs to load all of the .rb files in its current directory and all subdirectories. Currently, I am entering a new require statement for each file that I add but I would like to make it where I only have to place the…
juan2raid
  • 1,606
  • 1
  • 18
  • 29
20
votes
6 answers

Differences between unix and windows files

Am I correct in assuming that the only difference between "windows files" and "unix files" is the linebreak? We have a system that has been moved from a windows machine to a unix machine and are having troubles with the format. I need to automate…
svrist
  • 7,042
  • 7
  • 44
  • 67
20
votes
10 answers

Access File through multiple threads

I want to access a large file (file size may vary from 30 MB to 1 GB) through 10 threads and then process each line in the file and write them to another file through 10 threads. If I use only one thread to access the IO, the other threads are…
Ankit Zalani
  • 3,068
  • 5
  • 27
  • 47
20
votes
1 answer

check if file is open with lsof

I'm using linux mint 13 xfce and I have a file named wv.gold that I'm trying to check in bash if it's open by any program (for instance, I opened it in sublime-text and gedit) In many forums people say that if I run lsof | grep filename I should get…
rafa
  • 795
  • 1
  • 8
  • 25
20
votes
3 answers

Emacs lisp: Concise way to get `directory-files` without "." and ".."?

The function directory-files returns the . and .. entries as well. While in a sense it is true, that only this way the function returns all existing entries, I have yet to see a use for including these. On the other hand, every time a use…
kdb
  • 4,098
  • 26
  • 49
1 2 3
99
100