Displaying 20 results from an estimated 194 matches for "fileno".
2001 Jun 15
2
openssh 2.9p1: data loss when stdout sent to a pipe
...1
+++ openssh-2.9p1/clientloop.c Fri Jun 15 14:13:32 2001
@@ -787,12 +787,15 @@
if (!compat20) {
/* enable nonblocking unless tty */
+ /* REMOVED for now since it prevents ssh command output from
+ being reliably sent to a pipe. - PHS 2001/06/15
if (!isatty(fileno(stdin)))
set_nonblock(fileno(stdin));
if (!isatty(fileno(stdout)))
set_nonblock(fileno(stdout));
if (!isatty(fileno(stderr)))
set_nonblock(fileno(stderr));
+ */
max_fd = MAX(max_fd, fileno(stdin));
max_fd = MAX(max_fd, fileno(stdout));
max_fd = MAX(max_fd,...
2008 May 20
7
Problems sending large results with backgroundrb
...er). We are using packet-0.5.1 and
backgroundrb from the latest svn mirror.
We have found and fixed one problem in the packet sender. This is
triggered when the non-blocking send in NbioHelper::send_once cannot
send the entire buffer, resulting in an exception in the line
write_scheduled[fileno] ||= connections[fileno].instance
in Core::schedule_write because connections[fileno] is nil. I can''t
claim to fully understand the code, but I think there are two problems
here.
The main issue seems to be that when Core::handle_write_event calls
write_and_schedule to schedule the write...
2013 Aug 27
1
[plyr] Moving average filter with plyr
...a moving average to all the subparts of the dataframe (the example data can be found here https://dl.dropboxusercontent.com/u/2414056/testData.Rdata).
require(plyr)
load("testData.Rdata")
applyfilter<-function(x){
return(filter(x,rep(1/5, times=5)))
}
data.trash<-ddply(data, .(FileNo, ChannelNo), transform, filtered=applyfilter(ChannelB))
The result from this is
Error in attributes(output[[var]]) <- attributes(value) : invalid time series parameters specified
though the number of return values seems right to me.
Do you have any thoughts or suggestions?
Many thanks,
I...
2011 Oct 18
1
How to read data sequentially into R (line by line)?
....html) but the
problem is how to avoid cutting one record from the middle? I mean
that if I put nrows = 1000000, I don't know if one record (between
marks GG!KK!KK! and GG!KK!KK! is ending up in two files). How to avoid
that? My code so far:
zz <- file("myfile.txt", "r")
fileNo <- 1
repeat{
gotError <- 1 # set to 2 if there is an error # catch the
error if not more data
tryCatch(input <- read.csv(zz, as.is=T, nrows=1000000, sep='!',
row.names=NULL, na.strings="", header=FALSE),
error=function(x) gotError <<- 2)...
2020 Jul 25
0
[klibc:master] stdio: Define all the _unlocked functions and macros
...usr/klibc/fputs.c | 1 +
usr/klibc/fread2.c | 1 +
usr/klibc/fwrite2.c | 2 ++
usr/klibc/stdio/clearerr.c | 1 +
usr/klibc/stdio/feof.c | 1 +
usr/klibc/stdio/ferror.c | 1 +
usr/klibc/stdio/fflush.c | 2 +-
usr/klibc/stdio/fgetc.c | 1 +
usr/klibc/stdio/fileno.c | 1 +
12 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/usr/include/stdio.h b/usr/include/stdio.h
index 1d45fe1a..521213df 100644
--- a/usr/include/stdio.h
+++ b/usr/include/stdio.h
@@ -48,17 +48,24 @@ __extern int fseek(FILE *, off_t, int);
#define fseeko fseek
__extern void...
2004 Nov 06
3
Calling CreateFile on an instance of File - possible?
...nied" or "Error opening file: The process cannot
access the file because it is being used
by another process.", depending on the flag I use.
So, is it even possible to call CreateFile() to get a HANDLE? Or is there
some way I could use the existing file descriptor? I tried using fileno,
but had no luck.
Or, am I simply going to have to force this to be a class method?
Regards,
Dan
1999 Jun 30
0
How to backup from Win to Linux using smb
...DDS-3 tapes with 12 gb (before
compression) capacity work nicely for us. We also do incrementals on most
of the Unix systems, and avoid making copies of program files on the Win
systems.
Here's the script:
-------------- next part --------------
#! /bin/csh
if ($#argv == 0) then
set fileno = 0
else
set fileno = $1
endif
set SMBC=/usr/local/samba/bin/smbclient
cd /backup
set TAPE=/dev/nrst0
set EXCLUDE=(windows winnt dos xnfs orcadwin MAXPLUS2 emacs OmniX OmniNFSXe \
MSOffice Office wpwin60 Acrobat3 engr wpc20 DMI ATI PAGEMGR KPCMS OPLIMIT \
wpwin60 dell mouse vibra16 te...
2003 May 14
0
vnconfig(8), bin/45754
...@@ -351,8 +352,10 @@
if (verbose)
printf("%s: not configured\n", dev);
rv = 0;
- } else
+ } else {
+ status--;
warn("VNIOCDETACH");
+ }
} else if (verbose)
printf("%s: cleared\n", dev);
}
@@ -366,6 +369,7 @@
else
rv = ioctl(fileno(f), VNIOCUSET, &l);
if (rv) {
+ status--;
warn("VNIO[GU]SET");
} else if (verbose)
printf("%s: flags now=%08x\n",dev,l);
@@ -380,6 +384,7 @@
else
rv = ioctl(fileno(f), VNIOCUCLEAR, &l);
if (rv) {
+ status--;
warn("VNIO[GU]CLEAR")...
2004 Nov 07
2
Problems with DeviceIoControl()
...inBuf = COMPRESSION_FORMAT_DEFAULT;
if((rbBool != Qtrue) && (rbBool != Qfalse)){
rb_raise(rb_eTypeError,"Argument must be true or
false");
}
if(rbBool == Qfalse){
inBuf = COMPRESSION_FORMAT_NONE;
}
fn =
NUM2INT(rb_funcall(self,rb_intern("fileno"),0,0));
h = (HANDLE)_get_osfhandle(fn); // Get HANDLE based
on fileno
if(h == INVALID_HANDLE_VALUE){
rb_raise(cFileError,ErrorDescription(GetLastError()));
}
rv = DeviceIoControl(
h,
FSCTL_SET_COMPRESSION,
(LPVOID)inBuf,
sizeof(inBuf),
NULL...
2010 Apr 09
1
[PATCH] Add SSH transfer method
...h(@command, "stat -c %s $path; cat $path");
+
+ # Close the ends of the pipes we don't need
+ close($stdin_write);
+ close($stdout_read);
+ close($stderr_read);
+
+ # dup2() stdin, stdout and stderr to pipes
+ open(STDIN, "<&".fileno($stdin_read))
+ or die("dup stdin failed: $!");
+ open(STDOUT, "<&".fileno($stdout_write))
+ or die("dup stdout failed: $!");
+ open(STDERR, "<&".fileno($stderr_write))
+ or die("dup stderr fai...
2007 Jul 18
1
nested for loop
Hi,
I am new to programming and R. I am reading the manual and R books by Dalgaard and Veranzo to help answer my questions but I am unable to figure out the following:
I have a data file that contains 1080 data points. Here's a snippet of the file:
[241] 0.3603704000 0.1640741000 0.2912963000 NA 0.0159259300 0.0474074100
I would like to break the file up into 30
2011 Jun 03
1
[PATCH] JOBS: fix klibc DEBUG compilation
...6): undefined reference to `freopen'
src/show.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/show.c b/src/show.c
index 14dbef3..b4160e1 100644
--- a/src/show.c
+++ b/src/show.c
@@ -394,7 +394,9 @@ opentrace(void)
if ((flags = fcntl(fileno(tracefile), F_GETFL, 0)) >= 0)
fcntl(fileno(tracefile), F_SETFL, flags | O_APPEND);
#endif
+#ifndef SMALL
setlinebuf(tracefile);
+#endif /* SMALL */
fputs("\nTracing started.\n", tracefile);
}
#endif /* DEBUG */
--
1.7.4.4
2013 Nov 01
7
[PATCH] construct listener_fds Hash in 1.8 compatible way
...do |sock|
# IO#close_on_exec= will be available on any future version of
# Ruby that sets FD_CLOEXEC by default on new file descriptors
# ref: http://redmine.ruby-lang.org/issues/5041
sock.close_on_exec = false if sock.respond_to?(:close_on_exec=)
- [ sock.fileno, sock ]
- end]
+ listener_fds[sock.fileno] = sock
+ end
ENV[''UNICORN_FD''] = listener_fds.keys.join('','')
Dir.chdir(START_CTX[:cwd])
cmd = [ START_CTX[0] ].concat(START_CTX[:argv])
--
1.8.4
___________________________________...
2017 Sep 28
5
rename multiple files by file.rename or other functions
Hi,
I have 50 files whose names are
XYZW01Genesis_ABC.mp3
XYZW02Genesis_ABC.mp3
.......
XYZW50Genesis_ABC.mp3
As you can tell, the only difference across the files are 01, 02,
03,....50.
I would like to rename them to
01Gen01.mp3
01Gen02.mp3
.......
01Gen50.mp3
If I store them in one folder and write an R code in that folder, how can
it be done?
Thanks,
John
[[alternative
2017 Sep 28
0
rename multiple files by file.rename or other functions
Hi John,
Maybe this:
filenames<-c("XYZW01Genesis_ABC.mp3","XYZW02Genesis_ABC.mp3")
for(filename in filenames) {
filefirst<-sapply(strsplit(filename,"[.]"),"[",1)
fileno<-sub("_","",gsub("[[:alpha:]]","",filefirst))
file.rename(filename,paste("01Gen",fileno,".mp3",sep=""))
}
Jim
On Thu, Sep 28, 2017 at 7:37 PM, John <miaojpm at gmail.com> wrote:
> Hi,
>
> I have 50 files w...
2017 Feb 09
1
[PATCH] Fix compile with cygwin
...Y */
#else
diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c
index 2e1fdd5..d3b6e03 100644
--- a/src/libFLAC/stream_decoder.c
+++ b/src/libFLAC/stream_decoder.c
@@ -1253,9 +1253,6 @@ FILE *get_binary_stdin_(void)
*/
#if defined _MSC_VER || defined __MINGW32__
_setmode(_fileno(stdin), _O_BINARY);
-#elif defined __CYGWIN__
- /* almost certainly not needed for any modern Cygwin, but let's be safe... */
- setmode(_fileno(stdin), _O_BINARY);
#elif defined __EMX__
setmode(fileno(stdin), O_BINARY);
#endif
diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_e...
2010 Apr 18
3
Exporting PDF
Hi everyone,
I have written a script which exports my graphs as a PDF file using the
function pdf().
For instance, I run the script and it exports a PDF called "version 1".
Then, I have got a new dataset and want to run the script again. What it
usually does is overwriting "version 1". But I want it to check if "version
1" already exists. If so, then I want the new
2006 Nov 21
3
Fw: re. win32-process
...app_name,
:inherit => true,
:creation_flags => Process::DETACHED_PROCESS,
:startup_info => {
:startf_flags => Process::STARTF_USESTDHANDLES,
:stdout => my_out,
:stderr => my_err
}
)
I think it would be neat if you could pass IO objects (or perhaps a fileno) to :stdout, :stderr, and :stdin directly. Any ideas on how to do that?
Thanks,
Dan
----- Forwarded Message ----
From: Kirill Miazine <km at krot.org>
To: Daniel J. Berger <djberg96 at yahoo.com>
Sent: Monday, November 20, 2006 12:35:40 PM
Subject: re. win32-process
Hello Daniel,-...
1998 Nov 18
5
PC Backup Script?
I am trying to setup my Sun running samba 1.9.18p10 so that it can
backup my dept's PCs. I can get it to work manually using the
smbclient command with no problem. What I would like to do is have
a script that is able to take a list of PCs, determine if a PC is online,
backup that PC, then move on to the next one. If a PC is down,
it can report an error to the admin to state that the
2008 Apr 12
6
Cutting down BackgrounDRb memory issue
Hi Folks,
I have been working to fix BackgrounDRb memory usage as such. Ruby1.8 GC
isn''t fork friendly and it seems to use a lot of memory because when you
fork, it sets a bit in all the objects in global scope which causes OS
to all pages in child process.
A classic solution is to use fork and exec, rather than just fork. Its
working and pretty stable, but you loose ability to pass