|
Well, the title says it all. When passing a file name to a method, should I use a FileInfo object or a plain file name (string)? Why would I prefer one to the other?
Some of my colleagues like to write method like this:
void Export(FileInfo fileInfo) ...
Started by Martin on
, 11 posts
by 11 people.
Answer Snippets (Read the full thread at stackoverflow):
However, there's certainly plenty of precedent for passing a file name as a string, including most ....
Typically I would.
I think file name will suffice if it is doing the same thing.
In the argument name what it is.
|
|
Hello,
Using Java: I am reading a directory containing files with Greek Names. But when i output a String containing a file name i get this ' .something'.
Is it because i am running the java app. through the console?
Is there a way to get non-latin file...
Started by andreas on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
It could well be reading in the file names correctly; the most likely explanation is that your.
|
|
I like to create a batch file (winxp cmd) that recursively goes through a chose folder and sub folders and renames there files+folders with the following rules:
from all file + folder names, all uppercase+lowercase "V" and "W" letters need to be replaced...
Started by Tom on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Directories are a bit trickier (at least;nul') do ( set _file=%%~nf set _file_orig=!_file! for %%r in (%Replaces%) do call set _file=!!!_file:%....
The following batch does this for the file names at least.
|
Ask your Facebook Friends
|
Assume I have a file pointer FILE* myfile . Is there a way to retrieve the name of the file where myfile is reading from or writing to?
Started by Pieter on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
That should structure....
You could probably dig an operating system handle out of the FILE is then the operating system support you'd need to map a file handle back to a file name.
The file name to get a FILE*.
|
|
In Java the file name must be the public class name defined in that java file. Does C# has similar requirement? can I have a A.cs file which only defines a public Class B inside? thanks,
Started by 5YrsLaterDBA on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Implicit in this statement is that it is even possible to define more than... .
In fact, it is not necessary to have a relationship between the name of the containing file and any classes that are defined in the file.
In the file.
|
|
I have a directory structure like this:
- Root - Versioned deployment folder - config file
The "Versioned deployment folder" name varies with each version of the application. The config file name stays the same.
I'd like to write a batch file that opens...
Started by JoshL on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
The batch....
It seems like there's some missing bit of information here.. .
Hope this helps.
X is the file name length.
Store this in a variable and you can strip out the file name using %variable:~0,-x%.
The file path.
|
|
How do I find the name of the file that is the "importer", within the imported file?
If a.py and b.py both import c.py , is there anyway that c.py can know the name of the file importing it?
Started by Walking Wiki on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
It's the job ....
Why do you need to know where a file is being imported from? Why not have imported it.
The file that does the importing ( a.py and b.py ) pass in a name into c.py ? (assuming you have control the stack can be buggy.
|
|
Hi,
I wonder if we can get the file name including its path from the file object that we have created for the file name in C and in C++ respectively
FILE *fp = fopen(filename, mode); // in C ofstream out(filename); // in C++ ifstream in(filename); // ...
Started by Tim on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
The file may have the reference....
It may not even be associated have had a file name, as it may be standard input, output, or error, or a socket.
There is no portable way to retrieve the file name of a FILE* object.
|
|
I need to copy multiple files from a directory using a textfile that doesnt contain complete info.
NCR.txt:
Red
target directory has in it:
red1.txt
red3.txt
red44.txt
dest directory needs to have:
red1.txt
red3.txt
red44.txt
My code:
System.IO.Directory...
Started by Mike on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Foreach (FileInfo file in files) { file.CopyTo) destination.Create(); foreach (FileInfo file in files) { file.CopyTo(destination.FullName = Directory.GetFiles(sourceDir, "red....
Is what's really important for your application.
|
|
When i want to create a java class it is generating automatically a file with the same name of class.
But when it generate a class, it can change the file name different than class name.. Am i missing something?
Started by uzay95 on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Isn't Specification :
When packages....
To enforce the restriction that it is a compile-time error if a type is not found in a file under a name time can be saved from forcing guys to not create file classes.cs and put ALL code in it.
|