https://src.bluestatic.org
/
printdrop.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8469ad0
)
Renaming the uploaded PDF and we now delete it at the end
author
Robert Sesek <rsesek@bluestatic.org>
Tue, 26 Feb 2008 16:48:55 +0000
(11:48 -0500)
committer
Robert Sesek <rsesek@bluestatic.org>
Tue, 26 Feb 2008 16:48:55 +0000
(11:48 -0500)
Source/AppController.m
patch
|
blob
|
history
diff --git
a/Source/AppController.m
b/Source/AppController.m
index feaafda8336d321d3d6e5456710012c07a3b6080..0a0aaf962caed023ff9d4d052280bbc371c5d812 100644
(file)
--- a/
Source/AppController.m
+++ b/
Source/AppController.m
@@
-136,10
+136,10
@@
[self setStatus:@"Bad username/password" isError:YES];
goto shutdown;
}
[self setStatus:@"Bad username/password" isError:YES];
goto shutdown;
}
- /*
+
stat([[dragRegion filePath] UTF8String], &fileInfo);
stat([[dragRegion filePath] UTF8String], &fileInfo);
- LIBSSH2_CHANNEL *channel = libssh2_scp_send(ssh, "~/
tempupload
.pdf", 0755, (unsigned long)fileInfo.st_size);
+ LIBSSH2_CHANNEL *channel = libssh2_scp_send(ssh, "~/
__bu_print_drop__
.pdf", 0755, (unsigned long)fileInfo.st_size);
if (!channel)
{
[self setStatus:@"Unable to open upload SCP session" isError:YES];
if (!channel)
{
[self setStatus:@"Unable to open upload SCP session" isError:YES];
@@
-177,9
+177,8
@@
libssh2_channel_wait_closed(channel);
libssh2_channel_free(channel);
channel = NULL;
libssh2_channel_wait_closed(channel);
libssh2_channel_free(channel);
channel = NULL;
- */
-
LIBSSH2_CHANNEL *
channel = libssh2_channel_open_session(ssh);
+ channel = libssh2_channel_open_session(ssh);
if (!channel)
{
[self setStatus:@"Could not open SSH channel for printing" isError:YES];
if (!channel)
{
[self setStatus:@"Could not open SSH channel for printing" isError:YES];
@@
-203,7
+202,13
@@
// read the banner
[self readChannel:channel];
// read the banner
[self readChannel:channel];
- char *cmd = "touch /u17/ugrad/rsesek/temp.foo\r\n\0";
+ // send the job to lpr
+ char *cmd = (char *)[[NSString stringWithFormat:@"touch ~/print-%@.drop\r\n\0", printer] UTF8String];
+ libssh2_channel_write(channel, cmd, sizeof(char) * strlen(cmd));
+ [self readChannel:channel];
+
+ // remove our temp file
+ cmd = "rm -f __bu_print_drop__.pdf\r\n\0";
libssh2_channel_write(channel, cmd, sizeof(char) * strlen(cmd));
[self readChannel:channel];
libssh2_channel_write(channel, cmd, sizeof(char) * strlen(cmd));
[self readChannel:channel];