Sponsored Content
Full Discussion: Can DOS close an open file?
Special Forums Windows & DOS: Issues & Discussions Can DOS close an open file? Post 302272712 by reborg on Wednesday 31st of December 2008 01:09:16 PM
Old 12-31-2008
Not easily and not directly through DOS. You would have to write a control for excel to close and reopen the file.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File status - open/close ??

Is there any commands in UNIX, like isopen(),isclose() to know whether a file has been opened for read/write purpose.? Thanks (3 Replies)
Discussion started by: Pal
3 Replies

2. UNIX for Dummies Questions & Answers

Should a UNIX daemon process close open fds?

I have a UNIX daemon process that's been started by a parent process, an application server. The behavior of this daemon process is to inherit and use the app server's file descriptors (ports/sockets). When I shutdown the app server, the daemon continues to run, because there may be other... (1 Reply)
Discussion started by: kunalashar
1 Replies

3. Solaris

close open files before remove

Hi I have a script to remove log files when it reaches %70 usage in order to descending order of dates. But sometimes it happens to remove open - being processes files , so makes them unlinked from the directors and results them disappeared. How can I solve this problem , simple scenario I... (9 Replies)
Discussion started by: xramm
9 Replies

4. UNIX for Advanced & Expert Users

Number of open files (Dir's) how to close?

I am having a client/server application which will download files from server. If server has directories, it will create directories/sub directories and then download files. In this process, I observed that number of open files are more than 400 (which is approxmately same as number of dir/subdir... (1 Reply)
Discussion started by: satyam90
1 Replies

5. Solaris

file open/read/write/close/access by process

Hi want to know what file (descriptor+filename+socket) is being accessed by particular process on solaris. Purpose : while running perf. test, needs to find where is the bottleneck. We are providing concurrnet load for around 1 hr and needs to capture data related to file usage pattern... (1 Reply)
Discussion started by: raxitsheth
1 Replies

6. UNIX for Dummies Questions & Answers

Emptying a file (bring the size of the file down to 0 , or close to 0)

Hi I tried to empty an existing file (bring the size of the file down to 0). When I used “> myFile” or “cat </dev/null >myFile”, when I do a “ls –la”, the file size shows as 0. I then wrote 540 lines to the file, and then opened it using vi, I see something like this: "myFile" 540 lines,... (3 Replies)
Discussion started by: qmqmqm
3 Replies

7. Programming

when parent process close, how to close the child?

can someone provide an example, where if the parent process quits for any reason, then the child process will also close? (3 Replies)
Discussion started by: omega666
3 Replies

8. IP Networking

Open/close of ports

Hi, I have read some forum theads about the open and close ports. some points are clear and it is not working on my machine or something am i missing? I have commented out a port /etc/services, one application uses then when i use the telnet <hostname> <port_blocked> it shows connected..... (1 Reply)
Discussion started by: balamv
1 Replies

9. Shell Programming and Scripting

Work with setsid to open a session and close it correctly

I would like to create the following script: run a python script with setsid python may or may not fail with exception check if all of the group processes were terminated correctly if not, kill the remaining processes How can I do that? Thanks a lot (3 Replies)
Discussion started by: ASF Studio
3 Replies

10. Shell Programming and Scripting

How to get value from a close and open parenthesis?

Hi Gurus, I have an input like the one below. What i wanted to achieved is to create a select statement based from that information INPUTInsert into table_name (col1,col2,col3,col4,col5,DATE1,DATE2,col6,col7,col8,col9,col10,col11) values (6752,14932156,24,'ALL','Staff',to_date('04/17/2017... (6 Replies)
Discussion started by: ernesto
6 Replies
Log::Handler::Output::File(3pm) 			User Contributed Perl Documentation			   Log::Handler::Output::File(3pm)

NAME
Log::Handler::Output::File - Log messages to a file. SYNOPSIS
use Log::Handler::Output::File; my $log = Log::Handler::Output::File->new( filename => "file.log", filelock => 1, fileopen => 1, reopen => 1, mode => "append", autoflush => 1, permissions => "0664", utf8 => 0, ); $log->log(message => $message); DESCRIPTION
Log messages to a file. METHODS
new() Call "new()" to create a new Log::Handler::Output::File object. The following options are possible: filename With "filename" you can set a file name as a string or as a array reference. If you set a array reference then the parts will be concat with "catfile" from "File::Spec". Set a file name: my $log = Log::Handler::Output::File->new( filename => "file.log" ); Set a array reference: my $log = Log::Handler::Output::File->new( # foo/bar/baz.log filename => [ "foo", "bar", "baz.log" ], # /foo/bar/baz.log filename => [ "", "foo", "bar", "baz.log" ], ); filelock Maybe it's desirable to lock the log file by each write operation because a lot of processes write at the same time to the log file. You can set the option "filelock" to 0 or 1. 0 - no file lock 1 - exclusive lock (LOCK_EX) and unlock (LOCK_UN) by each write operation (default) fileopen Open a log file transient or permanent. 0 - open and close the logfile by each write operation 1 - open the logfile if C<new()> called and try to reopen the file if C<reopen> is set to 1 and the inode of the file has changed (default) reopen This option works only if option "fileopen" is set to 1. 0 - deactivated 1 - try to reopen the log file if the inode changed (default) How to use fileopen and reopen Please note that it's better to set "reopen" and "fileopen" to 0 on Windows because Windows unfortunately haven't the faintest idea of inodes. To write your code independent you should control it: my $os_is_win = $^O =~ /win/i ? 0 : 1; my $log = Log::Handler::Output::File->new( filename => "file.log", mode => "append", fileopen => $os_is_win ); If you set "fileopen" to 0 then it implies that "reopen" has no importance. mode There are three possible modes to open a log file. append - O_WRONLY | O_APPEND | O_CREAT (default) excl - O_WRONLY | O_EXCL | O_CREAT trunc - O_WRONLY | O_TRUNC | O_CREAT "append" would open the log file in any case and appends the messages at the end of the log file. "excl" would fail by open the log file if the log file already exists. "trunc" would truncate the complete log file if it exists. Please take care to use this option. Take a look to the documentation of "sysopen()" to get more information. autoflush 0 - autoflush off 1 - autoflush on (default) permissions The option "permissions" sets the permission of the file if it creates and must be set as a octal value. The permission need to be in octal and are modified by your process's current "umask". That means that you have to use the unix style permissions such as "chmod". 0640 is the default permission for this option. That means that the owner got read and write permissions and users in the same group got only read permissions. All other users got no access. Take a look to the documentation of "sysopen()" to get more information. utf8 If this option is set to 1 then UTF-8 will be set with "binmode()" on the output filehandle. log() Call "log()" if you want to log messages to the log file. Example: $log->log(message => "this message goes to the logfile"); flush() Call "flush()" if you want to re-open the log file. This is useful if you don't want to use option "reopen". As example if a rotate mechanism moves the logfile and you want to re-open a new one. validate() Validate a configuration. reload() Reload with a new configuration. errstr() Call "errstr()" to get the last error message. close() Call "close()" to close the log file yourself - normally you don't need to use it, because the log file will be opened and closed automatically. PREREQUISITES
Carp Fcntl File::Spec Params::Validate EXPORTS
No exports. REPORT BUGS
Please report all bugs to <jschulz.cpan(at)bloonix.de>. If you send me a mail then add Log::Handler into the subject. AUTHOR
Jonny Schulz <jschulz.cpan(at)bloonix.de>. COPYRIGHT
Copyright (C) 2007-2009 by Jonny Schulz. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-11-21 Log::Handler::Output::File(3pm)
All times are GMT -4. The time now is 09:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy